Everything Looked Normal Until I Decoded It — A Hidden SQL Inje
A URL path segment contained a Base64-encoded user identifier that was decoded and inserted directly into a SQL query. An attacker could alter the decoded value to inject SQL syntax, causing database errors and changing query logic.
For the past three years, I have been actively studying and working in penetration testing and bug bounty hunting. Like many of you, I’ve spent countless hours staring at HTTP requests, enumerating subdomains, reading writeups, and searching for things that were never meant to be found.
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 Base64-decoded a user-supplied path value and concatenated it directly into a SQL query without parameterisation or validation.
Impact
An attacker could manipulate the database query, potentially accessing or altering data, though the text only demonstrates error-based confirmation and does not show data extraction.
What the attacker needed
Access to the vulnerable subdomain; ability to send crafted requests
The fix
The application should use parameterised queries or prepared statements so that user input is never concatenated into SQL.
How it was found
- Browse a subdomain and notice a URL path segment that looks like Base64 and displays a user's profile.
- Decode the Base64 value to reveal a simple identifier.
- Append a double quote to the identifier, re-encode it, and send the request; the response is normal.
- Append a single quote instead, re-encode, and send; the response shows a SQL syntax error.
- Send a true condition and a false condition in the injected value; the responses differ, confirming injection.
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.
A website took a hidden value from the web address, decoded it, and put it straight into a database command without cleaning it. By adding a special character like a single quote, the tester made the database complain, showing the input was being treated as part of the command. This lets an attacker change what the database does, potentially reading or altering data.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.