SQL Injection at Spotify
A WordPress-based subdomain of Spotify had a SQL injection vulnerability in a calculator feature that accepted a number. An attacker could inject SQL to dump the database, including its name and version.
Hey Folks, today I will talk about one of my findings at Spotify.At this blog post, we will talk about SQL Injection. I discovered it 9th May 2021.
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
Likely the calculator input was inserted into a SQL query without proper parameterisation or escaping.
Impact
An attacker could dump the entire database, including schema names and version information.
What the attacker needed
Access to the vulnerable subdomain
How it was found
- Find the calculator feature that asks for a number larger than 100.
- Enter a number and observe the response.
- Try special characters like a backslash to see if the response changes.
- Balance the query with characters like a single quote and comment to confirm injection.
- Use UNION queries to extract the database version and schema names.
- Automate extraction with SQLmap.
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 a website puts user input directly into a database command without checking it. Here, the calculator field let the attacker add extra database instructions, so they could read data they should not see.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.