Skip to content
Info disclosure Write-up Beginner

Dumping the content of a table, without Sql injection

An API endpoint returned a verbose database error when a required field was set to null, exposing the database type, table name, and column structure including sensitive fields. By brute-forcing company names, the attacker could retrieve all rows from the customer portal credentials table.

ugs20b126_cic.rajesh Follow

Published on medium.com

A bit about the target. All the requests were going in json.

Rajesh Sagar, on medium.com

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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application did not handle database errors gracefully and returned the raw database error message to the client, which included schema details and data.

Impact

The attacker could obtain sensitive data such as company IDs, invite codes, and password hashes, potentially leading to account takeover.

What the attacker needed

Access to the API endpoint; knowledge of company names

The fix

The application should catch database exceptions and return generic error messages to clients, and should validate input to prevent null values from reaching the database.

How it was found

  1. Send a POST request to /api/customers/invitation with a JSON body containing a company name and a null email.
  2. Observe the error response that reveals database details.
  3. Collect company names via OSINT and recon.
  4. Brute-force the company parameter with the collected names to retrieve rows from the customer_portal_credentials table.

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 write-up has not been written yet. The Original tab links to the source.

When a web application sends a request with missing or invalid data, it should respond with a simple error message. Here, the server instead showed a detailed database error that revealed the names of tables and columns, and even parts of the data. An attacker can use this information to learn about the database and then try to extract more data by guessing company names.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by ugs20b126_cic.rajesh

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.