how i found union based sql injection in hackerone public vdp pro
A URL path segment was vulnerable to SQL injection, allowing an attacker to manipulate the database query. The author used a union-based technique to extract database information such as the database name, user, and version.
Published on doordiefordream.medium.com
today i will explain “how i found sql injection on hackerone vdp public program”
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 inserted a URL path segment directly into a SQL query without proper parameterisation or escaping.
Impact
An attacker could read arbitrary data from the database, including database name, user, and version, and potentially more.
What the attacker needed
None
How it was found
- Send a single quote in a URL path segment and observe a 500 error.
- Add a comment sequence to balance the query and confirm normal response.
- Use ORDER BY with increasing numbers to find the number of columns (40).
- Use UNION SELECT with 40 columns and a negative value to force an empty original result.
- Identify column 2 as the vulnerable output column.
- Replace column 2 with database(), user(), and version() to extract 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.
A website often builds database queries using parts of the URL. If it does not clean these parts properly, an attacker can add extra database commands. Here, the author added a quote and other SQL keywords to a URL path and could read information from the database.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.