Dailydave mailing list archives

Re: DoS attacks using SQL Wildcards


From: "Paul Battista" <paul () securityexperiment com>
Date: Tue, 20 May 2008 10:32:03 -0500 (EST)

Great description of using SQL wildcards to perform a DoS!

I often use wildcards to test for the existence of a SQL injection
vulnerability.  Most times you do not need to put increased load on a
database in order to determine if it is vulnerable.  You can first find a
generic query that returns specific results and then craft a query with
wildcards where you expect the same result.

For example:
?username=bob
Should return same results as:
?username=bo[a-z]
?username=bo[abc]
But the following will fail to return the same results:
?username=bo[cde]

My recommendation to clients has been to treat these like any other SQL
injection vulnerability.  First queries must be parameterized so that user
input never affects SQL logic.  For example, the above query for "bo[a-z]"
will literally search for that string and not a string that starts in "bo"
and ends in any character a through z.  Only as a secondary control to
prevent against SQL injection, developers should whitelist or blacklist
user input.

Paul Battista

This paper discusses abusing Microsoft SQL Query wildcards to consume
CPU in database servers using only the search field present in most
common web applications.

It can be downloaded from
http://www.portcullis-security.com/uplds/wildcard_attacks.pdf

Majority of the Microsoft SQL Server based web applications are
vulnerable to this attack. Other databases could be vulnerable
depending on how the applications implement search functionalities
although common implementation of the search functionality in SQL
Server back-end applications is vulnerable.

There are real world scenarios and detailed analysis in the paper
which explains and shows the impact of this attack.


Regards,

--
Ferruh Mavituna
_______________________________________________
Dailydave mailing list
Dailydave () lists immunitysec com
http://lists.immunitysec.com/mailman/listinfo/dailydave



_______________________________________________
Dailydave mailing list
Dailydave () lists immunitysec com
http://lists.immunitysec.com/mailman/listinfo/dailydave


Current thread: