Skip to content
SQL injection Disclosed report Beginner

SQL injection in URL path leads to Database Access

The application inserts URL path parameters directly into backend SQL queries without sanitisation, allowing an attacker to break the query with a single quote. An attacker could use an SQL injection tool to dump the backend database and access user information.

tinopreter Follow

Originally disclosed on HackerOne

Critical 9.8 View original
  • Triaged in 13 hours
  • Fixed in 2 months
  • Disclosed after 5 months

Summary:

The application https://corporate.admyntec.co.za/ application has an SQL injection in the URL paths since it takes the ID numbers in there and insert them directly into the backend SQL query without sanitizing them. In the registration, user ID number(Passport or National ID), Organization number are requested, as well as relevant docs. These are all stored in the backend Database.

https://corporate.admyntec.co.za/customerInsurance/newCustomerStep8/userId/868878/customerId/732562'/contactPersonId/0

Steps To Reproduce:

  1. Using the URL generated when we get displayed the Insurance.
image.png
image.png From the original on HackerOne
  1. Introduce a single quote next to the customerId number and you realize this breaks the backend query.
https://corporate.admyntec.co.za/customerInsurance/newCustomerStep8/userId/868878/customerId/732562'/contactPersonId/0  
image.png
image.png From the original on HackerOne
  1. Send this URL to any SQL epxloitation tool like SQLmap, Add an asterisk to the customerId number to tell the tool that's the injection point. We can dump the database now.
image.png
image.png From the original on HackerOne

##Please Note That This Occurs throughout many URL paths in the application.

#Recommendation If you are taking parameters and inserting them into the backend SQL query, sanitize them to do away with any special characters attached to them.

Consider putting the application behind a WAF to make a potential SQLi vulnerability exploitation a bit tedious for an attacker.

Impact

An attacker can exploit this to dump and download the backend database. This will give them access user information.

The original report as published on HackerOne, by tinopreter. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 application fails to sanitise or parameterise user-supplied URL path parameters before including them in SQL queries.

Impact

An attacker could dump and download the backend database, gaining access to user information.

What the attacker needed

Access to the application URL

The fix

Parameters inserted into SQL queries should be sanitised to remove special characters, and the application should be placed behind a WAF to make exploitation more difficult.

How it was found

  1. Use the URL generated when the Insurance page is displayed.
  2. Add a single quote next to the customerId number in the URL to break the backend query.
  3. Send the URL to an SQL exploitation tool like SQLmap, marking the customerId as the injection point with an asterisk, to dump the database.

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.

The website takes numbers from the web address and puts them straight into database commands without checking them. By adding a special character like a single quote, an attacker can change the command and make the database reveal its contents. This is called SQL injection.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

More by tinopreter

View all

8 more disclosed reports, best first.

More from MTN Group

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.