SQL injection in searchArticles function in fossbilling/fossbilling
Reported on
Jun 29th 2023
Description
The searchArticles
function in the KB module
makes a call to the getSimpleResultSet
function, with the per_page
parameter taken from the user without sanitizing before entering the query, leading to the attacker being able to manipulate the query.
Proof of Concept
GET /admin/kb?CSRFToken=4632faf87f0cd5fb8b324915263a01fa&_url=%2Fadmin%2Fkb&search=123&per_page=123' HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Referer: http://localhost/admin/kb
Cookie: PHPSESSID=1nkrr4p8ikra2g2sov3fubp273
PoC Image
Impact
SQL injection
Your POC appears to be a completely normal request and your image isn't loading
Sorry, i just update PoC Image. My PoC Video: https://drive.google.com/file/d/1DQwx5vEGlBkuxeLH3HoC7PwjxGGFsbjW/view?usp=sharing
This has been validated, however it goes deeper than your post originally states as there are both client and guest API endpoints that will pass the provided limit to the pagination function and that it can be used to delete entire tables, meaning exploitation requires zero permissions and can result in a complete loss of access.
The severity has been updated to a 9.8 to reflect this and this pull request enforces the correct type (an int) on the pagination functions: https://github.com/FOSSBilling/FOSSBilling/pull/1392