Skip to content
SQL injection Disclosed report Beginner

Blind Sql Injection in https://████

A blind SQL injection was found in the User-Agent header of a website, allowing an attacker to inject SQL commands into the backend database. This could lead to unauthorised access to sensitive data or manipulation of database content.

iamunixtz Follow

Originally disclosed on HackerOne

  • Triaged in 4 days
  • Fixed in 47 days
  • Disclosed after 49 days

Bug Bounty Report

Summary

A SQL injection vulnerability was discovered in the User-Agent parameter of the website https://██████████/. This vulnerability allows an attacker to inject SQL commands through the User-Agent HTTP header, potentially leading to unauthorized access to sensitive data stored in the backend database.

████

Impact

  • Successful exploitation of this vulnerability allows an attacker to execute arbitrary SQL commands on the backend database management system (MySQL >= 8.0.0, MariaDB fork).
    • Potential impact includes unauthorized access to sensitive data, manipulation of database content, and even complete compromise of the database server

System Host(s)

███

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

  1. SQLMap Command:

    sqlmap --url "https://█████████/" --batch --random-agent --level 5 --risk 3
    
  2. Injection Point Identified:

    Parameter: User-Agent (User-Agent)
        Type: boolean-based blind
        Title: OR boolean-based blind - WHERE or HAVING clause
        Payload: -5127 OR 2687=2687
    

Suggested Mitigation/Remediation Actions

Recommendations

  • Immediate Mitigation:

    • Implement input validation and parameterized queries to sanitize user inputs, especially HTTP headers like User-Agent.
    • Apply web application firewall (WAF) rules to detect and block SQL injection attempts.
  • Long-term Solutions:

    • Regular security assessments and penetration testing to identify and remediate vulnerabilities.
    • Educate developers about secure coding practices, including input validation and output encoding.

The original report as published on HackerOne, by iamunixtz. 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 SQL queries by concatenating the raw User-Agent header value instead of using parameterised queries.

Impact

An attacker could execute arbitrary SQL commands on the backend database, potentially leading to unauthorised access to sensitive data, manipulation of database content, and even complete compromise of the database server.

What the attacker needed

Ability to send HTTP requests with a custom User-Agent

The fix

The application should use parameterised queries and validate input, especially HTTP headers like User-Agent, and a WAF can help block injection attempts.

How it was found

  1. Run an automated SQL injection scanner against the target URL.
  2. The scanner identifies the User-Agent header as an injection point with a boolean-based blind technique.

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 takes the text your browser sends as its 'User-Agent' (a short label identifying the browser) and puts it into a database query without cleaning it. An attacker can add extra database instructions to that label, and the site will run them, which can let them read or change data they should not see.

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 iamunixtz

View all

2 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.