SQL DB Structure Extraction vulnerabilities
22:42 16.03.2010This is English version of my SQL DB Structure Extraction vulnerabilities article.
There is such variety of Information Leakage vulnerabilities as SQL DB Structure Extraction. This vulnerability lie in that there is information leakage in web application about structure of the database. This information leakage can be of use at SQL Injection attack.
Such vulnerability I found first time already in 2006 (at one site) and gave it this name. Such vulnerabilities I found at many web sites, particularly at bizua.com.ua, zoom.cnews.ru and job.ukr.net. And also in many web applications, particularly in WordPress (many times), W-Agora, Nucleus, Athree CMS (twice) and Abton.
Example of information leakage which occurs at using of one from SQL DB Structure Extraction vulnerabilities in WordPress:
SELECT * FROM wp_posts WHERE 1=1 AND (post_status = "publish" OR post_author = 1 AND post_status != 'draft' AND post_status != 'static') AND post_status != "attachment" AND post_status <> ‘trash’ GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT -30, 15
In this case important information it is name of table (wp_posts), particularly its prefix (wp), which is using in other tables of WP at vulnerable site.
What is the difference between SQL DB Structure Extraction and SQL Error? Because in both cases there is a message about error at request to database.
There are different messages about error in SQL query (SQL Error):
1. Only a message is showing about error at request to DB without any details. Sometimes at that there can be a message about a script, in which error occurs, including there can be mentioned full path to it at the server, which is Full path disclosure vulnerability. And in other cases there can be no details, only mentioning about error at request to DB.
2. A message is showing about error at request to DB and part of SQL query, in which there is error. In this case, usually, there is no leaked information about structure of DB. But in such cases it’s possible the conduction of XSS attacks via errors at requests to DB.
3. A message is showing about error at request to DB with detailed information about current SQL query (or several queries). When information about structure of DB is leaked - about tables and their fields in DBMS. And this variant is SQL DB Structure Extraction.
So SQL DB Structure Extraction vulnerability - it’s such variant of SQL Error, when error at request to database occurs and at the page (at notification about error at request to DB, or even without such notification) the information about structure of DB is showing.
Четвер, 16:32 18.03.2010
Would you please stop posting obvious things to security mailing lists? It would save us some time. Thanks.
Субота, 23:18 20.03.2010
zmx
Thanks for your attention to my article
. I’m glad that for you these things are obvious, for me they are obvious too. But for many people they can be not so obvious.
For example, it’s quite obvious that better to attend to security of your web site and to fix all holes, but most people have many holes at their sites and don’t care about security. Especially I see such complete ignorance in Ukraine, but in other countries this situation is not much better. So in security there are no obvious things
- one may know and understand something, others may don’t know or don’t understand it.
In this article I wrote about such class of vulnerabilities as SQL DB Structure Extraction (as I called it), which is subclass of Information Leakage. Because I used this term from 2006, so I decided to write an article, to describe this class in more details (for those who don’t know or don’t understand it). So I’ll be referencing to this article in future when it’ll be needed.
Try to read only those articles and advisories in mailing lists, which are interesting for you - it’ll save you a lot of time.
Неділя, 15:27 21.03.2010
Please stop posting obvious things to full-disclosure mailing list ? If you have an sec-list at Ukraine - post there twice ok ? Save us some time
Неділя, 16:22 21.03.2010
This is old stuff man.