Skip to content
SQL injection Disclosed report Beginner

SQL injection

A defunct admin panel was left reachable with default admin credentials and was vulnerable to blind SQL injection, though the researcher could not exploit it through the login form. A second endpoint found by search-engine dorking was also injectable, and the researcher used an automated tool to read the database banner and current user, later finding another subdomain sharing the same database.

alyssa_herrera Follow

Originally disclosed on HackerOne

  • Triaged in 2 days
  • Fixed in 34 days
  • Disclosed after 2 months

Summary by the researcher

Initially I discovered a Defunct admin panel with default credentials, admin/admin. This was vulnerable to a blind SQL Injection but I wasn't able to successfully exploit the login panel. I later google dorked for php files on the subdomain and ended up finding another end point that was vulnerable to SQLI. I then used SQLMap to exploit and then read the banner and user name of the website. I ended up discovering this sub domain and the previous SQL injection shared the same database. I later google dorked the end point and found another subdomain using the same end point and exploited it in a similar fashion to this one

The original report as published on HackerOne, by alyssa_herrera. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The researcher was working against a U.S. Department of Defence asset and started from a defunct admin panel that still accepted the default credentials admin/admin. That panel was vulnerable to blind SQL injection, but the researcher could not get a working exploit through the login form, so the panel itself did not yield a result.

From there the researcher used Google dorking to look for PHP files on the subdomain and found a second endpoint that was vulnerable to SQL injection. This endpoint is the one that was actually exploited. The researcher ran SQLMap against it, then read the banner and the user name of the website's database server. The report does not include the endpoint path, the parameter, the SQLMap command line or the returned banner and user name.

While working on that endpoint the researcher noticed that this subdomain and the earlier SQL injection shared the same database. A further Google dork for the endpoint turned up another subdomain using the same endpoint, which the researcher then exploited in a similar way.

The report is titled "SQL injection", is rated high severity, and was disclosed on 17 April 2018. It does not record a bounty amount, a CVSS score, a specific asset identifier or a remediation step.

Root cause

The report states that the endpoint was vulnerable to SQL injection but gives no request, parameter name or query, so the exact coding mistake is not shown. The exact coding mistake is not shown: the report gives no request, parameter name or query. Another subdomain used the same endpoint and shared the same database, which the report notes without explaining why.

Impact

The demonstrated impact is disclosure of database metadata: the banner and user name of the database server. That is enough to confirm the injection and to start mapping the environment. The report notes that this subdomain and the earlier SQL injection shared the same database. The report does not show extraction of application data, authentication bypass or command execution, so those outcomes should not be assumed here.

How this kind of bug works

SQL injection happens when an application builds a query by concatenating strings with input it has not constrained, so the input can change the query's meaning. Classic forms include quoting out of a string literal, appending a boolean or UNION clause, or injecting a subquery. Blind variants return no data directly: the attacker infers truth from differences in response content, status codes, timing or error behaviour. Time-based blind injection, for example, makes the database pause only when an injected condition is true.

Default credentials on an administrative panel are a separate but related problem: an old or forgotten panel with admin/admin gives an attacker a foothold and a place to probe for further flaws, even when the panel's own injection cannot be exploited.

Defences are well established: parameterised queries or prepared statements for every query, stored procedures used correctly, allow-listing for values that cannot be bound (such as sort column names), least-privilege database accounts, suppression of detailed database errors, and removal or decommissioning of unused administrative interfaces with default accounts changed or disabled.

How to test for it

  1. Map input that reaches the database: query string parameters, form fields, JSON bodies, cookies, and headers that applications log or filter on. Pay attention to numeric IDs, search and sort parameters, and login forms.
  2. Send a benign value and record the baseline response: body, status code, length and timing.
  3. Send a single quote or a syntax-breaking character and look for a database error, a changed status code or a different body. A generic error page is a weak signal; a database-specific error message is a strong one.
  4. For suspected blind injection, compare a true condition with a false one, for example an always-true versus always-false predicate in the same parameter, and look for a consistent difference in content or length.
  5. If content does not change, test timing: inject a condition that causes a deliberate delay only when true, and repeat it several times to rule out network jitter.
  6. Confirm with a harmless extraction of metadata such as the database version or current user, and stop there.

Common false positives: a quote that merely triggers input validation, a WAF block page that looks like an error, caching that makes two responses differ for unrelated reasons, and timing noise on slow links. Repeat each test and change only one variable at a time.

How it is fixed

Replace string-built queries with parameterised statements so input is always treated as data. Where identifiers cannot be bound, validate against a fixed allow-list. Give the application a database account with only the privileges it needs, and avoid accounts that can read other schemas. Disable verbose error output in production. Retire defunct panels and change or remove default accounts. If several subdomains share a database, fix the shared code once and verify every deployment that uses it.

Hunting notes

Injection can hide in older parts of an estate, such as forgotten admin panels and legacy PHP files, as this report shows. Google dorking for file extensions and parameter names on a scope's subdomains is a cheap way to surface these, as this report shows. Shared databases mean one finding can extend to sibling subdomains, so once an endpoint is confirmed, search for the same path or parameter elsewhere in scope.

State clearly what you did not attempt, and avoid touching real user data. If a panel only looks vulnerable but cannot be exploited, say so and keep it as context rather than as the finding.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 8 min read.

What happened, in plain words

This report is about a security researcher testing a website belonging to the U.S. Department of Defence. The researcher found a way to make the site's database answer questions it was never meant to answer. That class of bug is called SQL injection, and this report is rated high severity. It was disclosed on 17 April 2018.

A database is the part of a website that stores information: user accounts, page content, settings. A website talks to its database using a language called SQL, which is a bit like a set of instructions such as "find the user whose name is this". SQL injection means sneaking extra SQL instructions into a place where the website expected ordinary text, so the database ends up running the attacker's instructions too.

Step 1: a forgotten admin panel

The researcher first found a defunct admin panel. An admin panel is a private login page that lets staff manage a site. "Defunct" means it was old or abandoned, yet it was still reachable. It accepted the default credentials admin/admin, meaning the username was admin and the password was also admin. Default credentials are the factory settings a system ships with, and they are dangerous because anyone who knows the product can guess them.

That panel was vulnerable to blind SQL injection. "Blind" means the attacker cannot see the database's answers directly. Instead they ask yes/no questions and watch for indirect signs, such as a page that loads differently or a response that takes longer. The researcher could not get a working exploit through the login form, so this panel did not produce a result. The researcher could not exploit the panel and moved on to search for PHP files on the subdomain.

Step 2: finding a second endpoint

Next the researcher used Google dorking to look for PHP files on the subdomain. A subdomain is a section of a domain, like a separate building on the same campus. PHP is a programming language commonly used to build web pages. Google dorking means using advanced search operators to make a search engine surface files or pages that were not meant to be found, such as old scripts that are still online.

This turned up another endpoint that was vulnerable to SQL injection. An endpoint is a specific address on a website that accepts input and does something with it, for example a page that takes a search term. This second endpoint is the one that was actually exploited.

The researcher ran SQLMap against it. SQLMap is a free tool that automates finding and exploiting SQL injection. It sends many test inputs and watches how the site responds, which saves a lot of manual guessing. With it, the researcher read the banner and the user name of the website's database server. The banner is a short identification string a database service returns, often including its product and version. The user name is the account the website uses to talk to the database. Both are metadata, meaning information about the database itself rather than the private data inside it. Reading them is a safe way to prove the bug is real without touching anyone's personal information.

The report does not include the endpoint path, the parameter, the SQLMap command line, or the banner and user name that came back.

Step 3: the same database elsewhere

While working on that endpoint, the researcher noticed that this subdomain and the earlier SQL injection shared the same database. The report notes that this subdomain and the earlier SQL injection shared the same database. A further Google dork for the endpoint turned up another subdomain using the same endpoint, and the researcher exploited it in a similar way. The report does not record a bounty amount, a CVSS score, a specific asset identifier or a remediation step.

In general, how this kind of bug works

SQL injection happens when a website builds a database query by gluing together fixed text and whatever the visitor typed, without keeping the two apart. Imagine a form that asks for a name and then tells the database "find the person called" followed by the name. If someone types a name plus extra SQL, the database may treat the extra part as an instruction rather than as part of the name. The input changes the meaning of the query.

Common forms include breaking out of a quoted piece of text, appending a condition that is always true, or adding a UNION clause, which stacks a second query onto the first. Blind variants return no data directly: the attacker works out the truth from differences in response content, status codes, timing or error behaviour. A time-based blind injection, for example, makes the database pause only when an injected condition is true, so a slow response is the yes.

Default credentials on an admin panel are a related but separate problem. An old or forgotten panel with admin/admin gives an attacker a foothold and a place to probe for further flaws, even when the panel's own injection cannot be exploited.

Defences are well established: parameterised queries or prepared statements for every query, so input is always treated as data; stored procedures used correctly; allow-listing for values that cannot be bound, such as sort column names; database accounts with the least privilege they need; suppression of detailed database errors; and removal or decommissioning of unused admin interfaces, with default accounts changed or disabled.

How to test for it

  1. Map the input that reaches the database: query string parameters, form fields, JSON bodies, cookies, and headers the application logs or filters on. Pay attention to numeric IDs, search and sort parameters, and login forms.
  2. Send a harmless value and record the baseline response: body, status code, length and timing.
  3. Send a single quote or another character that breaks the query's syntax, and look for a database error, a changed status code or a different body. A generic error page is a weak signal; a database-specific error message is a strong one.
  4. For suspected blind injection, compare a true condition with a false one, for example an always-true versus an always-false condition in the same parameter, and look for a consistent difference in content or length.
  5. If the content does not change, test timing: inject a condition that causes a deliberate delay only when true, and repeat it several times to rule out network jitter.
  6. Confirm with a harmless extraction of metadata such as the database version or current user, and stop there.

Common false positives: a quote that merely triggers input validation, a web application firewall block page that looks like an error, caching that makes two responses differ for unrelated reasons, and timing noise on slow links. Repeat each test and change only one variable at a time.

How it is fixed

Replace string-built queries with parameterised statements so input is always treated as data. Where identifiers cannot be bound, validate against a fixed allow-list. Give the application a database account with only the privileges it needs, and avoid accounts that can read other schemas. Disable verbose error output in production. Retire defunct panels and change or remove default accounts. If several subdomains share a database, fix the shared code once and verify every deployment that uses it.

Hunting notes

Injection can hide in older parts of an estate, such as forgotten admin panels and legacy PHP files, as this report shows. Google dorking for file extensions and parameter names on a scope's subdomains is a cheap way to surface these, as this report shows. Shared databases mean one finding can extend to sibling subdomains, so once an endpoint is confirmed, search for the same path or parameter elsewhere in scope.

State clearly what you did not attempt, and avoid touching real user data. If a panel only looks vulnerable but cannot be exploited, say so and keep it as context rather than as the finding.

Glossary

  • SQL: the language websites use to ask a database to store or retrieve information.
  • Database: the part of a website that stores its information, such as accounts and content.
  • SQL injection: sneaking extra SQL instructions into input so the database runs them.
  • Blind SQL injection: injection where the attacker cannot see data directly and infers answers from indirect signs such as timing or page differences.
  • Admin panel: a private login page used by staff to manage a site.
  • Default credentials: the factory username and password a system ships with, such as admin/admin.
  • Defunct: old, abandoned or no longer maintained, but still reachable.
  • Subdomain: a section of a domain, like a separate building on the same campus.
  • PHP: a programming language commonly used to build web pages.
  • Google dorking: using advanced search operators to surface files or pages not meant to be found.
  • Endpoint: a specific address on a website that accepts input and acts on it.
  • SQLMap: a free tool that automates finding and exploiting SQL injection.
  • Banner: a short identification string a service returns, often including its product and version.
  • Metadata: information about the database itself rather than the private data inside it.
  • Parameter: a named value passed to a web page, often in the address after a question mark.
  • Cookie: a small piece of data a website stores in your browser to remember you between requests.
  • Header: extra information sent alongside a web request or response, such as the browser type.
  • Status code: the number a server returns to say how a request went, such as 200 for success or 500 for an error.
  • UNION clause: a SQL feature that combines the results of two queries, which an attacker can abuse to read other data.
  • Time-based blind injection: a blind technique that makes the database pause only when an injected condition is true.
  • Parameterised query: a way of building queries where input is always treated as data, never as instructions.
  • Prepared statement: a pre-built query with placeholders for input, a common form of parameterised query.
  • Stored procedure: a saved set of SQL instructions kept inside the database.
  • Allow-list: a fixed list of permitted values, used when input cannot be safely bound.
  • Least privilege: giving an account only the access it genuinely needs.
  • Web application firewall (WAF): a filter in front of a website that blocks suspicious requests.
  • False positive: a test result that looks like a bug but is not one.
  • CVSS: a standard scoring system for rating the severity of a vulnerability.
  • Remediation: the fix applied to close a vulnerability.

More by alyssa_herrera

View all

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