Click here to Skip to main content
15,886,592 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionMessage Closed Pin
15-May-15 4:15
Mohammad Sadegh Zohari15-May-15 4:15 
QuestionHelp with a static class Pin
Stephen Holdorf15-May-15 2:10
Stephen Holdorf15-May-15 2:10 
QuestionRe: Help with a static class Pin
Richard MacCutchan15-May-15 3:02
mveRichard MacCutchan15-May-15 3:02 
SuggestionRe: Help with a static class Pin
Richard Deeming15-May-15 3:56
mveRichard Deeming15-May-15 3:56 
GeneralRe: Help with a static class Pin
Stephen Holdorf15-May-15 4:09
Stephen Holdorf15-May-15 4:09 
GeneralRe: Help with a static class Pin
Richard Deeming15-May-15 4:11
mveRichard Deeming15-May-15 4:11 
GeneralRe: Help with a static class Pin
Stephen Holdorf15-May-15 6:52
Stephen Holdorf15-May-15 6:52 
GeneralRe: Help with a static class Pin
Richard Deeming15-May-15 7:04
mveRichard Deeming15-May-15 7:04 
holdorf wrote:
QueryContainer Instance = new QueryContainer("SELECT ac_sort_order FROM lkup_account_codes where ac_code = " + account.ToString());

No, no, no!!!

Your code is STILL vulnerable to SQL Injection.

You are STILL using string concatenation, rather than parameterized queries.

All you've done is store the compromised query in a field on a class, and then executed it. Like shutting the stable door after the horse has bolted, that provides precisely zero protection.

If you want to fix the SQLi vulnerability in your code, you MUST use parameterized queries. That means finding every part of your code which issues a query, and updating it to use parameters instead of string concatenation.

When you've finished, you should be able to mark all of the string variables containing your queries as const. If you can't, then you've almost certainly missed a parameter, and left your code vulnerable.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Help with a static class Pin
Sascha Lefèvre15-May-15 8:23
professionalSascha Lefèvre15-May-15 8:23 
GeneralRe: Help with a static class Pin
Stephen Holdorf18-May-15 1:47
Stephen Holdorf18-May-15 1:47 
GeneralRe: Help with a static class [modified] Pin
Sascha Lefèvre18-May-15 2:07
professionalSascha Lefèvre18-May-15 2:07 
GeneralRe: Help with a static class Pin
Sascha Lefèvre18-May-15 2:10
professionalSascha Lefèvre18-May-15 2:10 
GeneralRe: Help with a static class Pin
Richard Deeming18-May-15 2:36
mveRichard Deeming18-May-15 2:36 
GeneralRe: Help with a static class Pin
Stephen Holdorf18-May-15 3:48
Stephen Holdorf18-May-15 3:48 
GeneralRe: Help with a static class Pin
Richard Deeming18-May-15 3:50
mveRichard Deeming18-May-15 3:50 
GeneralRe: Help with a static class Pin
jkirkerx18-May-15 12:19
professionaljkirkerx18-May-15 12:19 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 3:02
Stephen Holdorf20-May-15 3:02 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:22
professionalSascha Lefèvre20-May-15 4:22 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 4:28
Stephen Holdorf20-May-15 4:28 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:34
professionalSascha Lefèvre20-May-15 4:34 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 4:40
Stephen Holdorf20-May-15 4:40 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:43
professionalSascha Lefèvre20-May-15 4:43 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 4:45
Stephen Holdorf20-May-15 4:45 
GeneralRe: Help with a static class Pin
Sascha Lefèvre20-May-15 4:54
professionalSascha Lefèvre20-May-15 4:54 
GeneralRe: Help with a static class Pin
Stephen Holdorf20-May-15 5:21
Stephen Holdorf20-May-15 5:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.