Skip to content
SQL injection Disclosed report Beginner

SQL Injection in Login Page: https://█████/█████████/login.php

The login page's username field was vulnerable to error-based SQL injection, as entering control characters produced an Oracle SQL error. An attacker could potentially exploit this to gain unauthorised access to the database, though the reporter did not attempt full exploitation.

l00ph0le Follow

Originally disclosed on HackerOne

  • Triaged in 9 days
  • Fixed in 17 days
  • Disclosed after 18 months

Summary: I believe I've discovered an error based SQL injection in the login page for https://████/██████/login.php.

Description: When browsing to the webpage https://█████/██████/login.php and entering certain control characters into the "Username" field, and SQL error (Oracle) is produced.

Impact

This is hard to gauge as I did not attempt to fully exploit the SQL injection point. Once I identified that it was an error-based SQL injection, I stopped. The website also has a Web Application Firewall and IPS implemented, so bypasses would need to be used to fully exploit it. I didn't know the rules for this program in regard to bypasses defenses with automated tools like sqlmap the --tamper parameter.

Step-by-step Reproduction Instructions

  1. Browse to https://█████████/███/login.php
  2. Enter " '; -- " into the username field
  3. The error "ORA-00933: SQL command not properly ended" is produced

Product, Version, and Configuration (If applicable)

██████████ █████████ Portal Version: 3.0.89 Last Modified: Oct 04, 2018

Suggested Mitigation/Remediation Actions

Parameterized queries should be used to separate the command and data portions of the intended query to the database. These queries prevent an attacker from tampering with the query logic and extending a concatenated database query string. Code reviews should be conducted to identify any additional areas were the application or other applications in the organization are vulnerable to this attack. Additionally, input validation should be enforced on the server side in order to ensure that only expected data is sent in queries. Where possible security specific libraries should be used in order to provide an additional layer of protection.

Impact

A skilled attacker could likely gain access to the database for the website, and depending on the privileges of the database user, gain access to other databases or compromise the system hosting the database engine.

The original report as published on HackerOne, by l00ph0le. 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 concatenates user input directly into an SQL query without proper parameterisation, causing syntax errors when special characters are entered.

Impact

A skilled attacker could likely gain access to the database and potentially compromise the hosting system, but a Web Application Firewall and IPS are in place, so bypasses would be needed for full exploitation.

What the attacker needed

Access to the login page; no authentication needed

The fix

Parameterised queries should be used to separate SQL commands from data, along with server-side input validation and code reviews.

How it was found

  1. Browse to the login page.
  2. Enter a specific string containing a single quote and comment characters into the username field.
  3. Observe the Oracle SQL error message.

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 a flaw where user input is inserted directly into a database command, letting an attacker change the command's meaning. Here, typing special characters into the login form caused the database to show an error message, which is a sign that the input is not safely handled. This could let an attacker read or modify data in 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.

More by l00ph0le

View all

8 more disclosed reports, 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.