SQLi | in URL paths
A parameter in a URL path was concatenated into a SQL query without sanitisation, so a single quote produced a database error. An attacker could use that injection point to dump the database and read user information.
Originally disclosed on HackerOne
- Triaged in 9 days
- Fixed in 9 days
- Disclosed after 39 days
Summary by the researcher
How is this in scope?
--> https://www.mtn.co.za/insurance/device-cover/
site:admyntec.co.za intitle:"MTN"
The report
Summary:
A SQL Injection vulnerability was discovered in the customerId parameter of the URL path:
███████
We can observe this by adding a little quote in the customerId:
█████████
which will show the following error, indicating that its vulnerable to SQL Commands Injection:
███████
Steps To Reproduce:
We can use any SQL Commend here, by just closing the Statement ( putting ') and then use a command and also we make sure to make the rest as a comment, here is a basic SQL command i used:
███████
or we can use tools like SQLmap to get access to the database, here is the command i used:
sqlmap -u "██████
██████
Impact
Summary:
An attacker can exploit this to dump and download the database, Which will give them access to user informations.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the customerId value taken from the URL path was concatenated directly into a SQL statement without parameterisation or validation.
Impact
An attacker could dump and download the database, gaining access to user information.
What the attacker needed
Reachable URL with customerId in path
How it was found
- Open the affected URL path that contains the customerId value.
- Add a single quote to the customerId value and load the page.
- Observe the database error that appears, confirming the injection.
- Close the statement and append a SQL command, commenting out the remainder.
- Optionally run an automated SQL injection tool against the URL to extract data.
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 report has not been written yet. The Original tab links to the source.
A website often builds database questions (queries) by gluing text together. If a value from the address bar is dropped straight into that text, a user can add their own database instructions. Here a stray quote character broke the query and revealed an error, showing the input was not being handled safely.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.