Ampache SQL injection (CVE-2019-12385)
Ampache contains an SQL injection in the search feature and a stored XSS in the localplay instance name field, which can be combined with CSRF to create an admin account. An attacker could exploit these to steal session cookies or escalate privileges.
tarlogic.com
Published on tarlogic.com
During a Red Team operation, multiple vulnerabilities where discovered in Ampache, an open source web platform for audio/video streaming. CVE codes have been assigned for two of them: CVE-2019-12385 (SQL injection) and CVE-2019-12386 (stored XSS).
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
Impact
An attacker could steal admin session cookies via SQL injection or, by combining CSRF and stored XSS, force an admin to create a new privileged account with a known password.
What the attacker needed
Ampache <=3.9.1; For SQLi: ability to perform searches (even guest); For XSS: admin visits a malicious page
How it was found
- Send a POST request to /search.php?type=song with a crafted rule_1_input parameter containing SQL code.
- Observe a 5-second delay confirming the injection.
- Reset the admin password to generate a weak 6-character password.
- Use the SQL injection to dump the password hash.
- Crack the hash using hashcat with the known character sets.
- For XSS: submit a form to localplay.php?action=add_instance with a name containing a script tag.
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.
Ampache is a web app for streaming audio and video. Two security holes were found: one lets a user insert database commands through a search box, and another lets an attacker store malicious JavaScript that runs when an admin views a page. Together, these could let an attacker take over an admin account.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.