How a Hidden GraphQL Endpoint Led Me to a Critical SQL Injection
A hidden GraphQL endpoint exposed a search field whose input reached a PostgreSQL database unsafely, allowing time-based blind SQL injection. An attacker could confirm SQL execution and enumerate schema and table names, though the author limited testing to metadata.
A simple directory fuzzing session uncovered a hidden GraphQL endpoint. A harmless-looking search bar eventually turned into a confirmed Critical (P1) SQL Injection with backend database enumeration.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the GraphQL search resolver passed the searchText parameter directly into a SQL query without parameterisation or input validation.
Impact
An attacker could confirm SQL execution and enumerate database schema and table names; the author intentionally did not extract user records or secrets, and the asset was a development environment, which reduced the bounty.
What the attacker needed
Access to the development environment; hidden /graphql endpoint reachable
The fix
The text says the issue would be fixed, but does not describe the fix; it should be fixed by parameterising the SQL query and validating the searchText input.
How it was found
- Fuzz directories on the target and find a /graphql endpoint returning HTTP 200.
- Open the endpoint to reveal a search interface.
- Submit a quote-based payload and observe an SQL-related error.
- Submit a time-based payload using PG_SLEEP(10) and observe a roughly ten-second delay.
- Repeat the timing test to confirm consistency.
- Save the request and replay it with an automated SQL injection tool against the searchText parameter to enumerate schema and tables.
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 write-up has not been written yet. The Original tab links to the source.
A search box on a website was passing what users typed directly into a database command without cleaning it first. By sending special text that tells the database to wait, the researcher could see the page pause, proving the database was running their input. This kind of flaw can let an attacker read or change data stored 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.