SQL Injection - entryid parameter in 'formbuilderv2-confirmation.php'
The entryid parameter of a form-builder confirmation endpoint was passed into a backend SQL query without proper handling, allowing injection. An attacker could use a tool like sqlmap to enumerate databases and potentially read or alter sensitive data.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 28 days
- Disclosed after 8 months
Description: Hi! I discovered a SQL Injection vulnerability via entryid on the website █████. The vulnerability allows for the manipulation of SQL queries executed by the backend database, which could potentially lead to unauthorized data access or manipulation.
References
█████████
Impact
The ability to manipulate SQL queries can lead to: Unauthorized access to sensitive data. Potential data leakage. Data manipulation or corruption. Full database compromise if administrative permissions are accessible.
System Host(s)
██████████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
Use the sqlmap:
sqlmap -r file3.txt --dbs --tamper=between -p 'entryid' --dbms=mysql --batch
Use the file3.txt:
POST /actions/formbuilderv2-confirmation.php HTTP/1.1
X-Requested-With: XMLHttpRequest
Referer: https███
Cookie: █████████
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 112
Accept-Encoding: gzip,deflate,br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Host: █████████
Connection: Keep-alive
entryid=1&formid=1&redirect=/form/apply-online/thank-you&useremail=
Suggested Mitigation/Remediation Actions
Use parameterized queries when dealing with SQL queries that contain user input. Parameterized queries allow the database to understand which parts of the SQL query should be considered as user input, therefore solving SQL injection.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely user input from the entryid parameter was concatenated into a SQL query instead of being sent as a bound parameter.
Impact
An attacker could gain unauthorised access to sensitive data, leak or corrupt it, and potentially compromise the whole database if the application's database account has administrative rights.
What the attacker needed
Network access to the endpoint; a valid session cookie
The fix
The endpoint should be fixed by using parameterised queries so user input is never treated as SQL code.
How it was found
- Send a POST request to the form-builder confirmation endpoint with the entryid parameter set.
- Run sqlmap against the captured request, targeting entryid, to enumerate databases.
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 report has not been written yet. The Original tab links to the source.
A web form sends a value called entryid to the server, and the server puts that value straight into a database command. By changing the value, an attacker can make the database run extra commands the developer never intended, which can expose or change stored data.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.