Skip to content
Info disclosure Write-up Beginner

How I Found an Exposed User Database via an Unprotected API (And How to Prevent It) in a private…

An unauthenticated Django REST API endpoint returned over 150 user records, including hashed passwords, emails and roles. An attacker could scrape this data and attempt to crack the password hashes or use the emails for phishing.

InsbatArshad Follow

Published on medium.com

Assalam o alaikum for muslim brothers, sisters and hello for non muslims, i hope all of you are doing well and learning new things day by day.

Be nice insabat, 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

The Django ViewSet had no permission_classes set, so the endpoint allowed unauthenticated access, and the serializer also included sensitive fields such as the password hash.

Impact

Hashed passwords, emails and roles of over 150 users were exposed, which could enable password cracking, targeted phishing and compliance violations.

What the attacker needed

None

The fix

The endpoint should require authentication and admin privileges, the serializer should exclude sensitive fields, and rate limiting should be added.

How it was found

  1. Run a directory brute-force tool against the target to discover endpoints.
  2. Find the user API endpoint that returns a list of users.
  3. Request the endpoint without authentication and observe the user records returned.

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.

An API is a way for programs to talk to each other, and this one was meant to be used only by logged-in staff. Because the developer forgot to add a permission check, anyone on the internet could ask it for the full list of users. The response even included password hashes, which are scrambled passwords that can sometimes be unscrambled by guessing.

What is Info disclosure?

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

More by InsbatArshad

View all

3 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.