Interesting case of SQLi
The application had a SQL injection vulnerability in a parameter of a POST request. An attacker could exploit it to access all data in the database.
#### Nik srivastava
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
This is a write-up of a SQL injection found on a Synack program, published by Nikhil (niks) (@niksthehacker) on Medium. The target application is a hosted e-invoicing solution: a third-party product that clients use to issue invoices, and that their own customers use to view and pay those invoices. The report does not name the program or the product.
The feature that matters here is the client-facing invoice flow. According to the demo video the researcher watched, clients do not log in to the application. Instead, specific links are generated and sent to their email address, and clicking such a link lets them view all information related to an invoice or pay it directly. The application also has a /portal/ path, which the researcher describes as looking like a core part of the application.
Setup
The researcher was assigned the program on Synack. The program had already had a SQL injection reported against it, as shown in its vulnerability analytics, and the researcher's goal was to find a second one on a different endpoint and a different parameter, which would also mean a full payout.
Only unauthenticated testing was allowed. The tools used were directory and file brute-forcing, subdomain discovery with sub-finder, and sqlmap for confirming and exploiting the injection. No versions are given in the report.
Finding it
The starting point was the behaviour of the application during directory and file brute-forcing. Every directory and file request redirected to a login page, and the login page redirected to a portal page, producing a redirect loop. Changing the HTTP method to see whether a particular method was restricted gave the same result.
The researcher then noticed that the application uses a third-party solution, which a search identified as a hosted e-invoicing solution. The idea was to retrieve the application's paths from that product and brute-force again with those paths. A copy of the product could not be obtained: a demo is only available on request, which the researcher did not want to go through.
Searching GitHub and similar sources for a demo version with credentials found nothing. The only other material was a YouTube demo video on the vendor's channel. From that video the researcher was able to disclose invoice details of all of their clients and found a few reflected XSS issues, but the objective remained SQL injection. The video also showed that the redirection only happens in directories under /portal/.
The next step was subdomain discovery, run with sub-finder.
This produced plenty of subdomains with demo instances running. The demo instances were not password protected, which the researcher found both convenient and strange. All demo instances had no authentication, while the other subdomains belonging to a client behaved the same way as the in-scope application, with the redirect loop on login. That raised the question of whether there was any authentication at all, which matched the demo video: clients do not need to log in, they receive generated links by email.
Exploitation
Step 1: Capture requests from the demo instances
The plan changed. Instead of brute-forcing application paths, the researcher captured all POST requests issued by the demo instances.
Step 2: Replay them against the in-scope domain
The captured POST requests were replayed with the domain replaced by the in-scope application domain. The report does not reproduce the requests themselves. The replay worked without the redirect loop.
Step 3: Test a parameter for SQL injection
With a working request in hand, the researcher checked a parameter for SQL injection and found it vulnerable, as expected.
Step 4: Exploit with sqlmap
sqlmap was run against the vulnerable parameter and returned access to all data.

Root cause
The report does not describe the server-side code, so the exact mistake is not stated. What it does show is that a parameter in a replayed POST request was vulnerable to SQL injection. and that the same request shape works across the demo instances and the in-scope application once the domain is swapped. The redirect loop on /portal/ directories did not prevent the replayed POST requests from working. Why the existing defences did not stop the injection is not described in the report.
Impact
The researcher ran sqlmap against the vulnerable parameter and obtained access to all data. The report does not enumerate which data was exposed beyond that statement. The researcher obtained the request from a demo instance and replayed it against the in-scope domain.
Fix
The report says the issue is fixed now but does not describe the change that was made.
Variants to test
- Look for a vendor product with publicly reachable demo instances and capture the POST requests those instances send. Replay them against the in-scope domain with the host replaced. A positive result is a response that no longer redirects to the login page and returns application data.
- When directory brute-forcing produces a redirect loop between a login page and a portal page, treat the loop as a routing artefact rather than proof that authentication is enforced, and test the endpoints that the application's own front end calls.
- On applications that use emailed links instead of logins, test the parameters in those links and in the POST requests behind them for injection. A positive result is a boolean or time-based difference that sqlmap can confirm.
- Check whether demo or staging subdomains of the same product share request formats with the production client subdomains. A positive result is a request accepted by production that was built from a demo instance.

The report was accepted within a couple of hours. Synack's maximum payout for SQL injection is $3k when blitz is not involved.
What happened, in plain words
A security researcher found a SQL injection on a Synack program's hosted e-invoicing application and got access to all data. The website was a hosted e-invoicing solution: a product that one company (the vendor) runs for other companies (its clients), who use it to send invoices to their own customers. The report does not name the program or the product.
The researcher was taking part in a bug bounty program on Synack, a platform where companies pay researchers to find security holes in their systems. The program had already had one SQL injection reported against it, and the researcher wanted to find a second one on a different part of the site, which would also mean a full payout.
The interesting part is how he got in. The main website kept redirecting him to a login page, and the login page kept redirecting him back, in a loop. Instead of giving up, he found demo instances of the product running on other subdomains, which had no authentication. He recorded the requests those demo versions sent, changed the domain name to the real target, and sent them again. They worked. Then he tested one of the parameters in those requests for SQL injection and found it vulnerable. He ran a tool called sqlmap and got access to all data.
He reported it and it was accepted within a couple of hours. Synack's maximum payout for SQL injection is $3k when blitz is not involved.
Background: the product and the feature
The target is a hosted e-invoicing solution. Think of it like an online shop platform: the vendor runs the software, and each client gets its own space on it. The client's customers do not have accounts. According to the demo video the researcher watched, clients do not log in to the application. Instead, specific links are generated and sent to their email address, and clicking such a link lets them view all information related to an invoice or pay it directly. The application also has a /portal/ path, which the researcher describes as looking like a core part of the application.
Setting up
The researcher was assigned the program on Synack. The program had already had a SQL injection reported against it, as shown in its vulnerability analytics, and the researcher's goal was to find a second one on a different endpoint and a different parameter, which would also mean a full payout.
Only unauthenticated testing was allowed. That means he could only test as an anonymous visitor, without logging in. The tools he used were directory and file brute-forcing (trying many common file and folder names automatically), subdomain discovery with a tool called sub-finder, and sqlmap for confirming and exploiting the injection. No versions are given in the report.
Finding it
The starting point was the behaviour of the application during directory and file brute-forcing. Every directory and file request redirected to a login page, and the login page redirected to a portal page, producing a redirect loop. Changing the HTTP method to see whether a particular method was restricted gave the same result.
A redirect is what a web server sends when it wants your browser to go somewhere else. A redirect loop is when two pages keep sending you to each other, so you never arrive anywhere useful. The researcher tried changing the HTTP method (the verb in a request, such as GET or POST) to see if one method was blocked, but got the same loop.
The researcher then noticed that the application uses a third-party solution, which a search identified as a hosted e-invoicing solution. The idea was to retrieve the application's paths from that product and brute-force again with those paths. A copy of the product could not be obtained: a demo is only available on request, which the researcher did not want to go through.
Searching GitHub and similar sources for a demo version with credentials found nothing. The only other material was a YouTube demo video on the vendor's channel. From that video the researcher was able to disclose invoice details of all of the vendor's clients and found a few reflected XSS issues, but the objective remained SQL injection. The video also showed that the redirection only happens in directories under /portal/.
Reflected XSS is a different bug where a website echoes back something you typed in a way that lets it run as code in someone else's browser. The researcher noted it but stayed focused on SQL injection.
The next step was subdomain discovery, run with sub-finder.
A subdomain is a prefix on a domain name, like shop.example.com versus www.example.com. Companies often run separate subdomains for demos, staging, or different clients. Sub-finder is a tool that tries many common subdomain names to see which ones exist.
This produced plenty of subdomains with demo instances running. The demo instances were not password protected, which the researcher found both convenient and strange. All demo instances had no authentication, while the other subdomains belonging to a client behaved the same way as the in-scope application, with the redirect loop on login. That raised the question of whether there was any authentication at all, which matched the demo video: clients do not need to log in, they receive generated links by email.
Exploitation
Step 1: Capture requests from the demo instances
The plan changed. Instead of brute-forcing application paths, the researcher captured all POST requests issued by the demo instances.
A POST request is what a browser sends when you submit a form or when a web page sends data to the server. Capturing it means recording the exact request, including the address, the headers, and the body, so it can be sent again later.
Step 2: Replay them against the in-scope domain
The captured POST requests were replayed with the domain replaced by the in-scope application domain. The report does not reproduce the requests themselves. The replay worked without the redirect loop.
Replaying means sending the same request again, possibly with small changes. Here the only change was the domain name: the request that went to a demo subdomain was sent to the real target instead. The fact that it worked without the redirect loop told the researcher that the real application accepted the same kind of request as the demo.
Step 3: Test a parameter for SQL injection
With a working request in hand, the researcher checked a parameter for SQL injection and found it vulnerable, as expected.
A parameter is a named value inside a request, like id=123 or invoice=456. SQL injection is a bug where a value you supply is placed into a database query without being properly separated from the query's own instructions. Imagine a form that asks for your name and then builds a sentence like "Hello, [your name]". If you type Alice. Now delete all records, and the system treats that as an instruction rather than a name, you have injected something. In SQL, the language databases use, the same idea lets an attacker change what the query does.
Step 4: Exploit with sqlmap
sqlmap was run against the vulnerable parameter and returned access to all data.

sqlmap is a free tool that automates the process of confirming and exploiting SQL injection. You give it a request or a URL, and it tries a series of payloads to see what the database will accept. Here it confirmed the injection and retrieved data.
Root cause
The report does not describe the server-side code, so the exact mistake is not stated. What it does show is that a parameter in a replayed POST request was vulnerable to SQL injection. and that the same request shape works across the demo instances and the in-scope application once the domain is swapped. The redirect loop on /portal/ directories did not prevent the replayed POST requests from working. Why the existing defences did not stop the injection is not described in the report.
Impact
The researcher ran sqlmap against the vulnerable parameter and obtained access to all data. The report does not enumerate which data was exposed beyond that statement. The researcher obtained the request from a demo instance and replayed it against the in-scope domain.
Fix
The report says the issue is fixed now but does not describe the change that was made.
Variants to test
- Look for a vendor product with publicly reachable demo instances and capture the POST requests those instances send. Replay them against the in-scope domain with the host replaced. A positive result is a response that no longer redirects to the login page and returns application data.
- When directory brute-forcing produces a redirect loop between a login page and a portal page, treat the loop as a routing artefact rather than proof that authentication is enforced, and test the endpoints that the application's own front end calls.
- On applications that use emailed links instead of logins, test the parameters in those links and in the POST requests behind them for injection. A positive result is a boolean or time-based difference that sqlmap can confirm.
- Check whether demo or staging subdomains of the same product share request formats with the production client subdomains. A positive result is a request accepted by production that was built from a demo instance.

The report was accepted within a couple of hours.
Glossary
- SQL injection: a bug where user-supplied input is inserted into a database query without proper separation, letting an attacker change the query's meaning.
- Endpoint: a specific address or URL path on a server that accepts requests, like a particular page or API route.
- Parameter: a named value sent with a request, such as
id=123in a URL or form body. - POST request: an HTTP request that sends data to the server, typically used when submitting a form.
- HTTP method: the verb in an HTTP request, such as GET (retrieve) or POST (submit).
- Redirect: a server response that tells the browser to go to a different address.
- Redirect loop: when two or more pages keep redirecting to each other, so the browser never reaches a final page.
- Subdomain: a prefix on a domain name, like
shop.example.comversuswww.example.com. - Brute-forcing: trying many possible names or values automatically until one works.
- Directory and file brute-forcing: trying many common folder and file names on a website to discover hidden paths.
- Sub-finder: a tool that discovers subdomains by trying common names.
- sqlmap: a tool that automates detecting and exploiting SQL injection.
- XSS (cross-site scripting): a bug where a website lets an attacker's code run in another user's browser.
- Reflected XSS: an XSS variant where the malicious input is immediately echoed back in the response.
- Unauthenticated: without logging in; as an anonymous visitor.
- Authentication: the process of proving who you are, usually by logging in.
- Hosted solution: software run by a vendor on its own servers and used by many clients, rather than installed on each client's own machines.
- Demo instance: a test copy of an application, often with sample data, made available for people to try.
- Vulnerability analytics: a dashboard or report showing which vulnerabilities have been reported against a program.
- Bug bounty program: a scheme where organisations pay researchers for finding and reporting security bugs.
- Synack: a platform that runs bug bounty and security testing programs.
- Blitz: the report notes the maximum payout applies when blitz is not involved.
- Payout: the money paid to a researcher for a valid report.
- Payload: the specific piece of input an attacker sends to trigger a vulnerability.