From a Simple id Parameter to an Exceptional (10.0)
An unauthenticated SQL injection in the id parameter of an event page allowed an attacker to read and potentially modify or delete database contents, including administrator records. The report was accepted and rated Exceptional (10.0).
medium.com
Published on medium.com
Cybersecurity
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.
Context
The target was a web application assessed through a Vulnerability Disclosure Program (VDP). The feature in question is an event page that displays event information based on a numeric identifier passed in the query string:
/event.php?id=1
Normally the page takes the id value, looks up the matching event in the backend database and renders the event details. Nothing about the endpoint suggested anything unusual at first glance.

The image is the article's header, introducing the write-up about the id parameter and the resulting SQL Injection.
Setup
The assessment was carried out against the application as reachable through the VDP, and the key precondition is simply that the endpoint could be reached without authentication: the injection was unauthenticated, so no login or special role was needed before exploitation.
Finding it
The starting point was a routine inspection of a numeric parameter. The researcher's habit when meeting a numeric parameter is to ask what happens when the application receives something other than a number. Small changes in the application's behaviour in response to such input suggested that backend database queries were being influenced by user input. That was enough evidence to keep investigating.
Exploitation
Step 1: Confirm the injection point
Further testing confirmed that the id parameter supported multiple SQL Injection techniques:
- Boolean-based Blind SQL Injection
- Time-based Blind SQL Injection
- UNION-based SQL Injection
The availability of UNION-based extraction significantly increased the impact, because it allowed database information to be retrieved directly through the application's responses. At that point the vulnerability was no longer theoretical: it was fully exploitable.
Step 2: Enumerate the database
With the injection point confirmed, the researcher began enumerating the backend database in a controlled manner. The application exposed multiple tables, including one responsible for user management. The assessment demonstrated that an attacker could retrieve sensitive information such as:
- Administrator account records
- Authentication-related information
- Application data
- Stored event information
The database account also possessed several privileges beyond simple read access, which increased the overall security impact if abused.
Root cause
User-controlled input was trusted before being sent to the database. Instead of validating the incoming value and using parameterized queries, the application allowed SQL statements to be influenced directly by user input. The id parameter was incorporated directly into a backend SQL query without proper validation.
Impact
Because no authentication was required before exploitation, the attack surface was available to anyone capable of reaching the vulnerable endpoint. An unauthenticated attacker could potentially:
- Read confidential database contents
- Enumerate application tables
- Access administrator authentication data
- Modify stored records if permitted
- Delete application data
- Abuse excessive database privileges
The report was successfully reproduced by the triage team before being forwarded to the organisation for remediation. The company then validated the issue and accepted the report, and the vulnerability received an Exceptional (10.0) severity rating.
Fix
Its recommendations for developers are:
- Use prepared statements and parameterized queries exclusively.
- Validate and strictly type-check all user input.
- Apply the principle of least privilege to database accounts.
- Rotate exposed credentials after remediation.
- Perform regular security testing and code reviews.
- Monitor applications for SQL Injection attempts and unusual database activity.
Variants to test
- A positive result is a response that differs systematically from the baseline for the same record.
- Boolean-based blind testing. Compare a true condition against a false one on the same parameter and look for a consistent difference in the returned page. A positive result is one response matching the normal record and the other diverging.
- Time-based blind testing. Introduce a deliberate delay condition and measure response time against a baseline request. A positive result is a reproducible delay only when the condition holds.
- UNION-based extraction. Attempt to append a UNION SELECT with a matching column count and observe whether data from other tables appears in the page. A positive result is reflected database content in the application's response.
- Privilege checks on the database account. After confirming read access, test whether the account can write or delete, since excessive privileges raise the impact. A positive result is a successful modification of a record the application exposes.
- Unauthenticated reachability. Repeat the tests without any session or credentials to establish whether the endpoint is exposed to anyone who can reach it.
What happened, in plain words
A security researcher was looking at a website that was part of a Vulnerability Disclosure Program (VDP). A VDP is a formal way for a company to say: "If you find a security problem in our website, tell us here, and we will look at it." It is like a lost-and-found desk for security bugs. The researcher found a serious flaw in a page that shows events. The page took a number from the address bar, called id, and used it to look up an event in the website's database. The database is the place where the site keeps its information, like a very large, very organised filing cabinet. The flaw was that the page put whatever the visitor typed straight into the database's instruction language, called SQL, without checking it. That let the researcher ask the database questions it was never meant to answer, including reading private information such as administrator accounts. No login was needed to do this. The company confirmed the problem, accepted the report, and rated it Exceptional (10.0). This article walks through the same steps the researcher took, explaining each idea from scratch.

The image is the article's header, introducing the write-up about the id parameter and the resulting SQL Injection.
The target: an event page
The website had a page for showing details about an event. The address looked like this:
/event.php?id=1
This is a URL, the address you type into a browser. The part before the question mark, /event.php, names the page. The part after the question mark is called the query string. It carries small pieces of information to the page. Here the query string is id=1, which means "the identifier is 1". The page reads that number, finds the matching event in the database, and displays it. Think of it like a cloakroom ticket: you hand over ticket number 1, and the attendant fetches coat number 1. The page was doing the same thing with event number 1.
Nothing about this address looked unusual. Many websites work this way. The researcher's job was to check whether the page trusted the number too much.
Setup: what was needed
The write-up does not describe any accounts, roles, tools or software versions. The important point is that the page could be reached without logging in. In security terms, the attack was unauthenticated: no username, password or special permission was needed before trying it. That matters because it means anyone who can open the page in a browser could, in principle, try the same thing.
Finding it: asking what happens with something other than a number
The researcher started with a routine inspection of the id parameter. A parameter is simply a named value passed to a page, like id here. The habit was to ask a simple question: what happens if the page receives something other than a number?
This is like a form that asks for your age. If you type 25, it works. If you type twenty-five, or 25; drop the table, does the form complain, ignore you, or behave strangely? Strange behaviour is a clue. In this case, small changes in how the page responded suggested that the value was being fed into the database's instructions. That was enough evidence to keep looking.
Exploitation
Step 1: Confirm the injection point
Further testing confirmed that the id parameter accepted several kinds of SQL Injection. SQL Injection is a vulnerability where user input is treated as part of a database command instead of as plain data. Imagine a waiter who writes your order on the kitchen ticket. If you say "one soup", that is fine. If you say "one soup and also give me the safe combination", a careless waiter might write the whole sentence down and the kitchen might act on it. SQL Injection is that, but with a database.
The write-up lists three techniques that worked:
- Boolean-based Blind SQL Injection
- Time-based Blind SQL Injection
- UNION-based SQL Injection
Each name describes how the researcher got information out. Boolean-based blind means the page does not show the data directly, but it answers yes or no to a question. By asking many yes/no questions, you can rebuild the answer. Time-based blind means the page does not show the data either, but you can make it pause when a condition is true. If a request that should be fast takes several seconds, that delay is the yes. UNION-based means you can attach a second query to the first one and have its results appear on the page. That is the most direct of the three, because the database's answer is shown to you.
The availability of UNION-based extraction significantly increased the impact, because it allowed database information to be retrieved directly through the application's responses. At that point the vulnerability was no longer theoretical: it was fully exploitable.
Step 2: Enumerate the database
With the injection point confirmed, the researcher began enumerating the backend database in a controlled manner. Enumerating means listing what is there, one item at a time, like opening a filing cabinet and reading the labels on each folder. The application exposed multiple tables, including one responsible for user management. A table is a grid of rows and columns inside a database, similar to a spreadsheet.
The assessment demonstrated that an attacker could retrieve sensitive information such as:
- Administrator account records
- Authentication-related information
- Application data
- Stored event information
Authentication-related information means the data the site uses to check who you are when you log in, such as stored account details. The database account also possessed several privileges beyond simple read access, which increased the overall security impact if abused. Privileges are permissions. A database account with read-only permission can look but not change anything. One with more privileges can change or delete records, which is much more dangerous if someone else gets control of it.
Root cause
User-controlled input was trusted before being sent to the database. Instead of validating the incoming value and using parameterized queries, the application allowed SQL statements to be influenced directly by user input. The id parameter was incorporated directly into a backend SQL query without proper validation.
A parameterized query is a way of writing a database command where the command and the data are kept separate. The database is told: "Here is the instruction, and here is a value to plug in later." The value is never treated as part of the instruction, so it cannot change the command. It is like a form with a blank box: whatever you write in the box stays in the box. The write-up does not describe any specific defence that was present and failed; the implication is that validation and parameterisation were simply absent.
Impact
Because no authentication was required before exploitation, the attack surface was available to anyone capable of reaching the vulnerable endpoint. An endpoint is simply a specific address on a website that does something, like a counter in a shop. An unauthenticated attacker could potentially:
- Read confidential database contents
- Enumerate application tables
- Access administrator authentication data
- Modify stored records if permitted
- Delete application data
- Abuse excessive database privileges
The report was successfully reproduced by the triage team before being forwarded to the organisation for remediation. Triage is the first review step: someone checks that the report is real and reproducible before passing it to the people who can fix it. The company then validated the issue and accepted the report, and the vulnerability received an Exceptional (10.0) severity rating.
Fix
Its recommendations for developers are:
- Use prepared statements and parameterized queries exclusively.
- Validate and strictly type-check all user input.
- Apply the principle of least privilege to database accounts.
- Rotate exposed credentials after remediation.
- Perform regular security testing and code reviews.
- Monitor applications for SQL Injection attempts and unusual database activity.
Prepared statements are the same idea as parameterized queries: the instruction is prepared first, and the values are supplied separately. Strict type-checking means checking that a value really is the kind of thing you expect, for example that id is a whole number. The principle of least privilege means giving each account only the permissions it actually needs, no more. Rotating credentials means replacing passwords or keys that may have been exposed. Monitoring means watching for suspicious patterns, such as requests that look like database commands.
Variants to test
- Numeric identifiers in query strings. Send a non-numeric value to any
?id=style parameter and watch for changes in behaviour, error output or response timing. A positive result is a response that differs systematically from the baseline for the same record. - Boolean-based blind testing. Compare a true condition against a false one on the same parameter and look for a consistent difference in the returned page. A positive result is one response matching the normal record and the other diverging.
- Time-based blind testing. Introduce a deliberate delay condition and measure response time against a baseline request. A positive result is a reproducible delay only when the condition holds.
- UNION-based extraction. Attempt to append a UNION SELECT with a matching column count and observe whether data from other tables appears in the page. A positive result is reflected database content in the application's response.
- Privilege checks on the database account. After confirming read access, test whether the account can write or delete, since excessive privileges raise the impact. A positive result is a successful modification of a record the application exposes.
- Unauthenticated reachability. Repeat the tests without any session or credentials to establish whether the endpoint is exposed to anyone who can reach it.
Glossary
- API: a way for one piece of software to talk to another, like a service counter where you make a request and get a response.
- Authentication: the process of proving who you are, usually with a username and password.
- Boolean-based blind SQL Injection: a technique where the page does not show data, but answers yes or no, allowing information to be rebuilt from many questions.
- Cookie: a small piece of data a website stores in your browser, often used to remember that you are logged in.
- Database: an organised store of information, like a large filing cabinet.
- Endpoint: a specific address on a website that performs an action.
- Enumerate: to list items one by one.
- Parameter: a named value passed to a page, such as
idin?id=1. - Parameterized query: a database command where the instruction and the data are kept separate so the data cannot change the command.
- Prepared statement: another name for a parameterized query.
- Privilege: a permission, such as the ability to read or change data.
- Query string: the part of a URL after the question mark that carries values to the page.
- Remediation: the fix applied to remove a vulnerability.
- Severity rating: a score describing how serious a vulnerability is.
- SQL: the language used to ask a database questions and give it instructions.
- SQL Injection: a vulnerability where user input is treated as part of a database command.
- Table: a grid of rows and columns inside a database.
- Time-based blind SQL Injection: a technique where a deliberate delay in the response reveals whether a condition is true.
- Triage: the first review of a security report to check it is real and reproducible.
- UNION-based SQL Injection: a technique where a second query is attached to the first and its results appear in the page.
- Unauthenticated: reachable without logging in.
- URL: the address of a page on the web.
- VDP (Vulnerability Disclosure Program): a formal channel for reporting security problems to an organisation.