
FAlvarez Jasso770844 (Community Member) asked a question.
Hi, I hope you're great.
Recently I spoke with one of Veracode Engineers Security, about this Flaw ID.
I had a method in C# that get's connection string, Engineer advised me that the best way to solve this Flaw is with a SQLConnectionStringBuilder. I did changes in my code but doesn't work, can you help me?. As you can see variables are setted on properties object, I have to mention this variables are never typed by user come by database depending a user token.
.
Thank you so much!
.png)
Hi @FAlvarez Jasso770844 (Community Member) ,
Veracode Static Analysis reports a flaw of CWE 15 if it can detect that data from an external source is used in a connection string.
The danger is that an attacker may inject their own options into the connection string used (see for example https://security.stackexchange.com/a/178791/3206 ).
I would recommend you do the following:
While using a ConnectionStringBuilder and encrypting the connection string are excellent controls, they cannot be automatically detected by Veracode Static Analysis.
As long as you have dynamic data in your connection string Veracode Static Analysis will not automatically close this flaw, however this does not mean that you are vulnerable to injection.
If you have adequate controls in place please document them in a mitigation proposal ( more info here: https://help.veracode.com/r/improve_mitigation ) and have this manually reviewed by your security team.
Thank you,
Boy Baukema