> As I alluded to but probably wasn't too clear on, if I can
> detect a SQL injection rather than just relying on
> CFQUERYPARAM, I can do something a bit more pro-active
> regarding a response.
>  
> For example, if I leave all of the work to CFQUERYPARAM, all
> I will get is an exception on the query which I can catch
> but, I can't be sure exactly why the exception occurred, is
> it a SQL injection, is it just a SQL problem, is my database
> alive etc, etc, etc. The catch section would have to have
> several handlers built into it to work effectively.
>
> On the other hand, by explicitly checking for SQL injections
> prior to hitting a CFQUERY, I know in a much more elegant way
> when I have found a SQL injection attempt and therefore I can
> do something more than just throw an excpetion. In my
> example, I DID choose to throw an exception but I could just
> as easily have returned a http 500 error or a http 403 or
> just a plain old 302 to the Disney site or do anything else I
> see fit to do.
>  
> I do use CFQUERYPARAM but I was always taught to program
> defensively and a mantra that I was given a long time ago was
> "Exception handlers are good...
> but if you can avoid them by coding intelligently, do so."
> That doesn't mean don't put exception handlers in your code,
> and personally, I use them liberally. The thing is, all I use
> them for is handling exceptions, not for getting out of
> writing validation routines to check on SQL injections etc :)

Unfortunately, you will probably find it difficult to uniquely identify
every case of potential SQL injection before sending stuff to the database.
On the other hand, it's relatively simple to identify database exceptions
caused by malform data.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to