Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 17 of 17 total
Thread QuotedSQLString and injection attacks?
Wed, Oct 10 2012 4:22 AMPermanent Link

Matthew Jones

Indeed, but since I can slip occasionally, I'd like to know if QuotedSQLString will
protect me.

/Matthew Jones/
Wed, Oct 10 2012 5:37 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Matthew


>Indeed, but since I can slip occasionally, I'd like to know if QuotedSQLString will
>protect me.

NO!!!!!

Roy
Wed, Oct 10 2012 9:02 AMPermanent Link

Matthew Jones

Why not? Surely it will be quoting the quotes to stop any "breaking out of string"?

/Matthew Jones/
Wed, Oct 10 2012 9:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Matthew


All QuotedSQLString does is stick quotes round things, and double up existing quotes. If this is just being used as a parameter in a WHERE clause you'll be pretty safe but it won't take out any potentially dangerous sql code (eg the famous DROP TABLE one) which could in some circumstances be run.

Relying on QuotedSQLString as a safety device is a big no no.

Roy Lambert [Team Elevate]
Wed, Oct 10 2012 2:07 PMPermanent Link

Matthew Jones

> which could in some circumstances be run.

In which circumstances? That's the key. How? Only if I've mucked up my SQL and
added a spare quote will it allow a hole, and I'd spot that immediately with the
good data.

/Matthew Jones/
Thu, Oct 11 2012 3:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Matthew

>> which could in some circumstances be run.
>
>In which circumstances? That's the key. How? Only if I've mucked up my SQL and
>added a spare quote will it allow a hole, and I'd spot that immediately with the
>good data.

If I'd had the faintest idea I would have told you <vbg>

Roy Lambert [Team Elevate]
Thu, Nov 1 2012 6:22 AMPermanent Link

Matthew Jones

http://stackoverflow.com/questions/13171048 is a variation on this, FWIW.

/Matthew Jones/
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image