Exploiting SQL Injection at Authorization token
The login page's Authorization header contained a base64-encoded username and password that were passed directly into a SQL query, allowing SQL injection. An attacker could bypass authentication and log in as an admin, then modify site content.
{{media:0}}
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 the Basic Authorization header and concatenated the username and password directly into a SQL query without parameterisation.
What the attacker needed
Access to the login page; ability to send custom HTTP requests
How it was found
- Visit the admin events page and choose the author login link.
- Enter a single quote as the username and password to trigger a SQL error.
- Inspect the request in Burp and notice the Authorization header contains a base64 value.
- Decode the base64 value to see it is the username and password separated by a colon.
- Send a request with a UNION SELECT payload in the base64-encoded credentials.
- Observe successful login to the admin panel.
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 login form usually checks your username and password against a database. Here, the site put the username and password into a database command without cleaning them first. By typing special characters, an attacker could trick the database into letting them in without a real password.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.