Skip to content
SQL injection Disclosed report Intermediate

Boolen Based Blind Sql Injection Via User Agent in ███.mil

A boolean-based blind SQL injection was found in the User-Agent header of a .mil SharePoint application. An attacker could infer database schema details and potentially sensitive information by observing different responses.

iamunixtz Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 6 months
  • Disclosed after 6 months

Bug Bounty Report: Boolean-Based Blind SQL Injection

Summary

I have discovered a boolean-based blind SQL injection vulnerability in the User-Agent header of the https://███████.mil/ application. This vulnerability can be exploited to extract sensitive data from the backend database by leveraging boolean-based blind SQL injection techniques. █████████

Impact

  • Information Disclosure: Attackers may infer database schema details and potentially sensitive information.

Database and Web Server Details

  • Database Management System: MySQL 8 (MariaDB fork)
  • Web Server Operating System: Windows
  • Web Application Technology: Microsoft SharePoint 16.0.0.5452

System Host(s)

████████.mil

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

Steps to Reproduce

  1. Set Up SQLMap: Run the following sqlmap command to initiate a boolean-based blind SQL injection test:

    Bash
    sqlmap --url https://█████████.mil/ --random-agent -risk 3 --level 5 --batch
    
  2. Identify Vulnerable Parameter: The User-Agent header is used to inject payloads. In this case, I used the following payload to test the boolean-based blind injection:

    Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10' AND 8074=8074-- KwOG
    
  3. Confirm Vulnerability: By injecting the payload, you can observe that the application responds differently based on the boolean condition provided (8074=8074).

  4. Test Using SQLMap or Burp Suite:

    • SQLMap: You can use sqlmap to further exploit the vulnerability and extract data.
    • Burp Suite: Manually craft and test boolean-based blind SQL injection payloads to infer database information.

Suggested Mitigation/Remediation Actions

  1. Sanitize User Inputs: Ensure that all user inputs, including headers like User-Agent, are properly sanitized and validated to prevent SQL injection attacks.
  2. Use Prepared Statements: Implement parameterized queries using prepared statements to safeguard against SQL injection vulnerabilities.
  3. Regular Security Audits: Conduct regular security assessments and penetration testing to identify and mitigate potential vulnerabilities.
  4. Update and Patch Systems: Regularly update and patch all components of the web application and database management system to protect against known vulnerabilities

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target is a host in the .mil namespace, https://███████.mil/, running Microsoft SharePoint 16.0.0.5452 on Windows, backed by MySQL 8 (described in the report as a MariaDB fork). The report does not describe what the application does beyond that stack fingerprint.

The vulnerability sits in the handling of the User-Agent request header. That header is normally a free-form string the browser sends to identify itself; the server has no reason to treat it as anything other than opaque text. The report shows that a crafted header value changes the logic of a database query.

Setup

The researcher needed no account or special role: the injection is reachable through an ordinary request to the site root. The only tool named in the report is sqlmap, used in batch mode with a random user agent, risk 3 and level 5. No credentials, cookies or other preconditions are described.

Finding it

The report does not describe the recon that led to the header. What it establishes is that the application's response changes depending on whether a boolean condition embedded in the User-Agent value is true or false. That difference in response is the only observable channel, which is why the technique is boolean-based blind: no query output or error text is used, only the true/false behaviour.

Exploitation

Step 1: Run sqlmap against the target

Bash
sqlmap --url https://█████████.mil/ --random-agent -risk 3 --level 5 --batch

--random-agent makes sqlmap send a randomised User-Agent on each request. --risk 3 and --level 5 widen the set of tests and payloads beyond the defaults, and --batch runs without interactive prompts. The report does not include sqlmap's output.

Step 2: Identify the vulnerable parameter

The injection point is the User-Agent header. The payload used to test it is:

Text
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10' AND 8074=8074-- KwOG

The single quote after 523.10 closes the string literal the application has opened around the header value. AND 8074=8074 is a condition that is always true, so the query keeps its original meaning.

Step 3: Confirm the vulnerability

With the always-true condition in place, the application responds one way. The report states that the application responds differently based on the boolean condition provided. That observable difference between the two responses confirms that the header value is being evaluated as SQL and gives a channel for asking the database yes/no questions.

Step 4: Extract data

The report states that sqlmap can be used to exploit the vulnerability further and extract data, and that Burp Suite can be used to craft and test boolean-based blind payloads manually to infer database information. No extraction session, dumped data or further payloads are shown.

Root cause

The report does not identify the root cause; it recommends sanitising inputs and using prepared statements. Because the application does not reflect query results or errors, the flaw only surfaces as a difference in response between a true and a false condition, which is why it was found with a blind technique. The report does not identify the specific code path or query; that part is likely a header-derived value written into a query without validation.

Impact

The report classifies the issue as information disclosure: an attacker may infer database schema details and potentially sensitive information through the true/false channel. The wording is hedged, and no data was demonstrated as extracted in the report. The exposure applies to whatever the vulnerable query can reach, and the researcher's stack fingerprint (MySQL 8, Windows, SharePoint 16.0.0.5452) indicates the backend involved.

Fix

The report lists remediation actions rather than a change that was made:

  1. Sanitise and validate all user inputs, including headers such as User-Agent.
  2. Use parameterised queries with prepared statements so header values are never parsed as SQL.
  3. Conduct regular security assessments and penetration testing.
  4. Regularly update and patch the web application and database components.

Variants to test

  • Other headers: try the same quote-and-boolean pattern in headers the application may log or store, such as Referer, X-Forwarded-For and custom headers. A positive result is a consistent difference in response between an always-true and an always-false condition.
  • Cookies and tracking values: values persisted to the database are candidates. A positive result is the same true/false behavioural split when the condition is flipped.
  • Different comment and whitespace syntax: if -- is filtered, try # or /* */ where the backend allows it. A positive result is the payload still parsing and the boolean still flipping the response.
  • Time-based confirmation: where response differences are ambiguous, a delay-based condition can corroborate the injection. A positive result is a measurable delay only when the condition is true.

Hunting notes

This bug class hides in values that developers treat as metadata rather than input: user agent strings, referrers, and anything written to an audit or analytics table. During recon, a SharePoint fingerprint and a stack that includes MySQL are worth noting, since header-derived logging queries are a plausible sink. The signal is a response that changes when a boolean condition in a header is flipped, even when nothing else about the request changes.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.

What happened, in plain words

A security researcher found a way to make a website belonging to the U.S. Department of Defence (a .mil address) answer questions about its own database. The trick was not in a login form or a search box. It was in a small piece of text that every browser sends automatically with every request: the User-Agent header.

Normally that header just says something like "I am Safari on a Mac". The server reads it, maybe writes it into a log, and moves on. On this host, a crafted value in that header changed the behaviour of a database query. That means a person who controls the header can add extra database instructions to it. The researcher used a technique called boolean-based blind SQL injection: instead of seeing the data come back, they ask the database yes/no questions and watch whether the page behaves differently for "yes" and for "no".

The report describes it as information disclosure: an attacker could work out details about the database structure and potentially sensitive information. The report does not show any data actually being extracted.

The target and what it runs

The host is https://███████.mil/. According to the report, it runs Microsoft SharePoint 16.0.0.5452 on Windows, with a MySQL 8 database behind it (the report describes MySQL 8 as a MariaDB fork).

A few of those words deserve a plain explanation:

  • SharePoint is Microsoft's product for building internal websites, document libraries and team sites. Companies use it as a place to store files and publish pages that staff can open in a browser.
  • MySQL is a database: a program that stores information in tables (rows and columns), much like a very large, very strict spreadsheet. Websites ask the database questions using a language called SQL.
  • Windows is the operating system the web server machine runs on.

The report does not say what the SharePoint site is used for beyond that stack fingerprint. It also does not say how the researcher found the header as a weak point; the recon that led there is not described.

What a header is, and why the User-Agent matters

When your browser asks a website for a page, it sends more than just the address. It sends a bundle of small text lines called HTTP headers. Think of them as the label on an envelope: the letter is the request, and the label carries handling instructions such as what kind of content the browser accepts and what language the user prefers.

The User-Agent header is the line where the browser introduces itself. It typically contains the browser name, version and operating system, for example a string that mentions Safari and Mac OS X. Websites use it to serve different versions of a page to different browsers, and analytics tools use it to count visitors by browser.

From the server's point of view, this header is free text supplied by whoever is making the request. Anyone can set it to anything: a browser, a script, a command-line tool. That is exactly why it must never be trusted as if it were code.

What SQL injection is

Websites talk to their database by building SQL queries: sentences such as "select the page with this name" or "insert this log entry". A safe website builds those sentences with placeholders and fills in the user's value separately, so the value can never be mistaken for part of the sentence. This is called a parameterised query or prepared statement.

An unsafe website glues the user's value straight into the sentence as text. If the value contains a special character that SQL treats as syntax, the meaning of the sentence changes. That is SQL injection.

A simple comparison: imagine a form that says "Write your name here" and a clerk who reads the whole line aloud as an instruction. If you write "Alice, and also open the safe", a careless clerk might do both. Parameterised queries are the clerk who treats everything on the line as a name, no matter what it says.

What "boolean-based blind" means

  • Boolean means true or false. A boolean condition is a statement like 8074=8074 (true) or 8074=8075 (false).
  • Blind means the attacker never sees the database output or an error message. The only thing they can observe is how the website responds: a slightly different page, a different length, a different status.

Put together, boolean-based blind SQL injection means the attacker slips a true/false question into the query and watches the website's behaviour to learn the answer. By asking many such questions ("is the first letter of the database name greater than 'm'?" and so on), an attacker can slowly reconstruct information one bit at a time, like playing twenty questions with a database.

Setup: what the researcher needed

The report describes no account, no login and no special role. The injection is reachable through an ordinary request to the site root. The only tool named is sqlmap, a free command-line program that automates the discovery and exploitation of SQL injection. No credentials, cookies or other preconditions are described.

Step 1: Run sqlmap against the target

The first step in the report is a single command:

Bash
sqlmap --url https://█████████.mil/ --random-agent -risk 3 --level 5 --batch

Line by line, in plain words:

  • sqlmap runs the tool.
  • --url https://█████████.mil/ tells it which address to test. The address is the site root, not a specific page with a form.
  • --random-agent makes sqlmap send a different, randomly chosen User-Agent string with each request.
  • -risk 3 raises the risk setting. sqlmap has a scale of tests from cautious to aggressive; higher values include payloads that are more likely to disturb the target but also more likely to find something.
  • --level 5 raises how many different places and techniques sqlmap tries. Higher levels mean more requests and broader coverage.
  • --batch tells sqlmap to run without stopping to ask the user questions, using default answers.

The report does not include sqlmap's output, so we do not know exactly what it printed when it found the injection.

Step 2: Identify the vulnerable parameter

In injection terms, the parameter is the piece of input that carries the payload. Here it is the User-Agent header. The report shows the payload used to test it:

Text
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10' AND 8074=8074-- KwOG

This looks like a normal browser string with a small addition at the end. Breaking it down:

  • Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/523.10.3 (KHTML, like Gecko) Version/3.0.4 Safari/523.10 is a plausible Safari user agent.
  • The single quote ' right after 523.10 is the important character. In SQL, text values are wrapped in quotes.
  • AND 8074=8074 adds a condition that is always true. Because it is true, the query still behaves as it originally would. This is the "yes" case.
  • -- KwOG starts a SQL comment. Everything after -- on that line is ignored by the database. KwOG is just random text after the comment marker.

Why this step matters: the researcher is not trying to break the site. They are trying to prove that the header value is being treated as SQL. A quote that changes the query's behaviour is the proof.

Step 3: Confirm the vulnerability

With the always-true condition in place, the application responds one way. The report states that the application responds differently based on the boolean condition provided. That difference between the two responses is the confirmation: the header value is being evaluated as SQL, and the researcher now has a channel for asking the database yes/no questions.

This is the heart of the blind technique. There is no error message to read and no table of results on screen. The only signal is: does the page look the same as before, or not?

Step 4: Extract data

The report states that sqlmap can be used to exploit the vulnerability further and extract data, and that Burp Suite can be used to craft and test boolean-based blind payloads manually to infer database information.

  • Burp Suite is a toolkit for inspecting and modifying web traffic. It sits between your browser and the website, letting you change a request (such as the User-Agent header) before it is sent, and read the response that comes back.

No extraction session, dumped data or further payloads are shown in the report. The report describes the capability, not a demonstrated data theft.

Why this happens: the root cause

The report does not identify the root cause; it recommends sanitising inputs and using prepared statements.

Because the application does not show query results or error messages, the flaw only shows up as a difference in response between a true and a false condition. That is why a blind technique was needed to find it. The report does not identify the specific code path or query; it is likely a header-derived value written into a query without validation.

Impact

The report classifies the issue as information disclosure: an attacker may infer database schema details and potentially sensitive information through the true/false channel. The wording is cautious, and no data was demonstrated as extracted in the report.

The exposure applies to whatever the vulnerable query can reach. The stack fingerprint in the report (MySQL 8, Windows, SharePoint 16.0.0.5452) tells you which backend is involved.

Fix

The report lists remediation actions rather than a change that was made:

  1. Sanitise and validate all user inputs, including headers such as User-Agent. In plain terms: check that the value looks like what you expect, and strip or reject anything that does not.
  2. Use parameterised queries with prepared statements so header values are never parsed as SQL. This is the real fix: the database receives the value as data, not as part of the instruction.
  3. Conduct regular security assessments and penetration testing. In other words, keep testing your own systems before someone else does.
  4. Regularly update and patch the web application and database components.

Variants to test

The technical write-up lists other places where the same pattern can appear. These are ideas for further testing, not findings from this report:

  • Other headers: try the same quote-and-boolean pattern in headers the application may log or store, such as Referer, X-Forwarded-For and custom headers. A positive result is a consistent difference in response between an always-true and an always-false condition.
  • Cookies and tracking values: values that get saved to the database are candidates. A positive result is the same true/false behavioural split when the condition is flipped.
  • Different comment and whitespace syntax: if -- is filtered out, try # or /* */ where the backend allows it. A positive result is the payload still parsing and the boolean still flipping the response.
  • Time-based confirmation: where response differences are ambiguous, a delay-based condition can corroborate the injection. A positive result is a measurable delay only when the condition is true.

Hunting notes

This bug class hides in values that developers treat as metadata rather than input: user agent strings, referrers, and anything written to an audit or analytics table. During recon, a SharePoint fingerprint and a stack that includes MySQL are worth noting, since header-derived logging queries are a plausible sink. The signal is a response that changes when a boolean condition in a header is flipped, even when nothing else about the request changes.

Glossary

  • Boolean: a value that is either true or false.
  • Boolean-based blind SQL injection: a technique where the attacker asks the database true/false questions and learns the answers only from differences in how the website responds.
  • Burp Suite: a toolkit for intercepting, inspecting and modifying web traffic between a browser and a server.
  • Cookie: a small piece of data a website stores in the browser and the browser sends back on later requests, often used to remember who you are.
  • Database: a program that stores information in tables and answers questions about it.
  • Header (HTTP header): a line of text sent alongside a web request or response, carrying extra information such as the browser type or accepted content.
  • Information disclosure: a weakness that lets someone learn information they should not be able to see.
  • MariaDB: a database program that is a fork (a separately maintained copy) of MySQL.
  • MySQL: a widely used open-source database program.
  • Parameter: in injection terms, the specific piece of input that carries the payload, such as a header value or a form field.
  • Parameterised query / prepared statement: a way of building a database query where user values are passed separately from the query text, so they cannot be interpreted as SQL.
  • Payload: the crafted input an attacker sends to trigger a vulnerability.
  • Penetration testing: authorised testing of a system to find security weaknesses before attackers do.
  • Query (SQL query): an instruction sent to a database, such as selecting, inserting or updating data.
  • Referer: an HTTP header that tells the server which page the browser came from.
  • Remediation: the fix or set of actions that removes a vulnerability.
  • Root cause: the underlying reason a vulnerability exists, as opposed to its symptoms.
  • Sanitise: to clean or check input so that dangerous characters cannot change the meaning of a command.
  • Schema: the structure of a database: its tables, columns and relationships.
  • Severity: a rating of how serious a vulnerability is, often low, medium, high or critical.
  • SharePoint: Microsoft's product for building internal websites, document libraries and team sites.
  • SQL: Structured Query Language, the language used to talk to relational databases.
  • SQL injection: a vulnerability where user input is interpreted as part of a database query, letting an attacker change what the query does.
  • sqlmap: a free command-line tool that automates finding and exploiting SQL injection.
  • Stack (technology stack): the combination of software a site runs on, such as an operating system, web server, application and database.
  • Time-based SQL injection: a technique where the attacker infers answers from how long the server takes to respond.
  • User-Agent: the HTTP header in which a browser identifies itself (browser name, version, operating system).
  • X-Forwarded-For: an HTTP header used by proxies to pass along the original client address.

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.