Yahoo – Root Access SQLI – tw.yahoo.com
The 's' parameter on a Yahoo stock JSON endpoint was not properly sanitised, allowing SQL injection via double URL encoding. An attacker could execute arbitrary SQL queries and retrieve database information, including the MySQL root user.
Published on buer.haus
I'll keep this one simple and sweet because anyone reading this blog probably knows what SQL Injection is. I discovered a root access SQL injection on tw.yahoo.com.
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 application decoded user input twice but only applied single-quote stripping after the first decode, leaving the second-decoded quote unescaped in the SQL query.
Impact
An attacker could read arbitrary data from the database, including the MySQL root user and potentially password hashes.
What the attacker needed
No authentication required; Target endpoint accessible
The fix
The vulnerability was fixed by validating the fix on 6/19/2014.
How it was found
- Send a request to the JSON endpoint with a normal stock ID to see the response format.
- Try a single quote in the 's' parameter and observe no server error.
- Send a double-encoded single quote (%2527) to bypass the filter.
- Append a UNION SELECT statement to extract database user and schema information.
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 cleaning, letting an attacker change the query's meaning. Here, the site tried to remove dangerous characters but only did so once, so a double-encoded quote slipped through and let the attacker run their own database commands.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.