Versions Tested
Two unauthenticated blind SQL injection vulnerabilities were found in the Unitrends Backup appliance, allowing an attacker to execute arbitrary SQL as the postgres superuser and achieve remote code execution. The attacker could gain shell access as the postgres account and potentially compromise the server and backup clients.
cyberonesecurity.com
Published on cyberonesecurity.com
By CyberOne Security TeamThis article was written by members of the CyberOne Security Team, drawing on decades of combined experience in cloud and network security, penetration testing, threat intelligence, and advisory services.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used the postgres superuser account for database access and inserted user-supplied parameters directly into SQL queries via sprintf without proper sanitisation.
Impact
An unauthenticated attacker could execute arbitrary SQL as the postgres superuser and achieve remote code execution, gaining shell access as the postgres account; this could potentially extend to backup clients.
What the attacker needed
Network access to the management interface
The fix
The vulnerabilities were fixed in later versions, as indicated by the security advisory link, but the text does not specify the exact fix; generally, input should be parameterised and least privilege should be used for database access.
How it was found
- Start a netcat listener.
- Create a payload file with the reverse shell string, updating LHOST and LPORT.
- Send a POST request using curl with the payload to receive a reverse shell running as postgres.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
SQL injection is when user input is inserted into a database query without proper handling, letting an attacker change the query's meaning. Here, the attacker could run their own database commands, and because the database user had high privileges, they could run system commands to take over the server. This is serious because no login was needed.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.