SQL injection on █████ due to tech.cfm
The sort parameter on a .cfm page was vulnerable to SQL injection, as shown by an error that disclosed the SQL query and by a time-based test that caused the page to hang. An attacker could access the database and harvest sensitive data or take over the website.
Originally disclosed on HackerOne
- Triaged in 5 days
- Fixed in 16 days
- Disclosed after 20 months
Summary by the researcher
The website had an end point like website.mil/xxx/xxx.cfm?sort=grade&type=2. I probed using an apostrophe which resulted in an error. I proceeded to exploit by using a time based query as a proof of concept.
The report
Summary: The website appears to be vulnerable to SQL injection due to inducing an sql error using a single ' Description: The following url, https://█████/hro/html/tech.cfm?Sort=Grade&ThisType=2 contains the parameter sort= which is vulnerable to SQLI. We know this due to the error disclosing the SQL query being used.
SELECT *, tbl_JobInfo.id as TJobID,tbl_JobDocs.id as DocID FROM dbo.tbl_JobInfo left outer join dbo.tbl_JobType on JobTypeID = tbl_JobType.id left outer join tbl_JobDocs on tbl_JobInfo.id = tbl_JobDocs.JobID WHERE JobTypeID = 3 AND JobTypeID > 1 AND Display = 'Y' Order by 'INJECTION' ASC1 We can then demonstrate vulnerability by using time based queries and I opted to instead keep my queries low impact as to not violate the rules.
Impact
High
Step-by-step Reproduction Instructions
https://███/hro/html/tech.cfm?Sort=SLEEP(25)&ThisType=3 This will cause the page hang to hang momentarily This won't cause the website to hang, https://█████████/hro/html/tech.cfm?Sort=SLEEP()&ThisType=3 Additionally included timing screen shots showing the time between the pages
Product, Version, and Configuration (If applicable)
N/a
Suggested Mitigation/Remediation Actions
Sanitize user input and prepare statements
Impact
An attacker could access the Database and harvest potentially sensitive data from the website or even take over the entire website through using certain SQL commands.
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 the application concatenated user input directly into a SQL query without parameterisation or sanitisation.
Impact
An attacker could access the database and harvest sensitive data or take over the entire website.
What the attacker needed
None
How it was found
- Visit the tech.cfm page with a sort parameter and add an apostrophe to trigger an SQL error.
- Observe the error message disclosing the SQL query.
- Use a time-based query in the sort parameter to cause the page to hang, confirming the injection.
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.
SQL injection is when user input is inserted directly into a database command, letting an attacker change the command. Here, the sort parameter was placed into the query without proper handling, so adding an apostrophe caused an error that revealed the query. A time-based test (asking the database to wait) confirmed the injection by making the page hang.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.