Skip to content
Info disclosure Write-up Beginner

I Found a Live AES Encryption Key in an Error Message — Respons

A registration endpoint returned a raw database error when a username exceeded the column length, exposing the full SQL INSERT statement, table and column names, and a hardcoded AES encryption key. An attacker could use this to map the schema for SQL injection and decrypt stored email addresses if they gained database access.

Shadow Follow

Published on medium.com

This is my writeup on YourDost a mental wellness platform used by thousands of people across corporates and universities in India. I was testing their application under their responsible disclosure program and what I found wasn’t just one bug.

SHADOW, 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 backend lacked server-side input validation and proper error handling, and stored a hardcoded AES key directly in the SQL query, so a database exception leaked the full query and key to the client.

Impact

An attacker could use the exposed schema to craft more precise SQL injection attacks and, if they ever gained read access to the database, decrypt every email address stored in the users table; the text does not claim direct database access from this bug alone.

What the attacker needed

A free account; ability to intercept HTTP requests

The fix

The backend should validate input length server-side, catch database exceptions and return generic error messages, and store encryption keys in a secrets manager rather than hardcoding them in SQL.

How it was found

  1. Intercept the signup request in Burp Suite.
  2. Modify the username field to a string over 255 characters.
  3. Forward the request to the server.
  4. Observe the 500 error response containing the SQL query and AES key.

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 website asks for a username, it checks the length in your browser, but the server should also check. Here, the server did not check, so sending a very long username caused a database error. The error message was sent back to the user and included the database query and a secret key used to encrypt emails, which is dangerous because it reveals how the database is built and how to decrypt data.

What is Info disclosure?

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

More by Shadow

View all

1 more disclosed report, 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.