Home / exploits mod_accounting 0.5 Blind SQL Injection
Posted on 27 September 2013
- Affected Vendor: http://sourceforge.net/projects/mod-acct/files/ - Affected Software: mod_accounting - Affected Version: 0.5. Other earlier versions may be affected. - Issue type: Blind SQL injection - Release Date: 20 Sep 2013 - Discovered by: Eldar "Wireghoul" Marcussen - CVE Identifier: CVE-2013-5697 - Issue status: Abandoned software, no patch available Summary mod_accounting is a traffic accounting module for Apache 1.3.x which records traffic numbers in a database. Both MySQL and PostgreSQL database types are supported. It supports arbitrary database designs as traffic recording is performed via a user defined query in the Apache configuration using placeholders for received values. The following is an example configuration: <VirtualHost _default_:*> DocumentRoot "/var/www/" Options Indexes AccountingQueryFmt "INSERT INTO accounting VALUES( current_time, %r, %s, '%u', '%h' );" AccountingDatabase accounting AccountingDatabaseDriver postgres AccountingDBHost localhost 5432 AccountingLoginInfo acct acct </VirtualHost> As user supplied values are not sanitised before being used in the placeholder values it is possible for an attacker to supply malicous values to perform blind SQL injection. Description The SQL injection occurs due to a user supplied HTTP header being used in the query without sanitisation. The module uses a simple string concatination approach to modify the placeholders in the user defined query before sending it to the database. This code can be located in mod_accounting.c: 409: // build the query string from the template 410: while( ptr ) { 411: char *next; 412: 413: next = strchr( ptr, '%' ); 414: 415: if( next ) { 416: char tmp[ 2 ]; 417: 418: *next++ = '
