Skip to content
Info disclosure Disclosed report Beginner

Insecure API Response Leads to Disclosure of Hashed Passwords

An API endpoint returned sensitive user information, including hashed passwords, in its response. The use of sequential numerical IDs made user accounts susceptible to enumeration, potentially allowing unauthorised access to credentials.

itsmatinx Follow

Originally disclosed on HackerOne

Medium 5.7 View original
  • Triaged in 16 hours
  • Fixed in 32 days
  • Disclosed after 40 days

Summary by the program

A security vulnerability has been identified in the API of ████████. The endpoint ████████ is found to return sensitive user information, including hashed passwords, in its response. This exposure presents a significant security risk as it potentially allows unauthorized access to user credentials. The vulnerability is further exacerbated by the use of sequential numerical IDs, which makes user accounts susceptible to enumeration attacks.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is the API of a Mars program asset, *.petpaw.com. The report is short and the program summary withholds the specific host and endpoint names, so the exact URL is not available here.

The finding is that an API endpoint returns sensitive user information, including hashed passwords, in its response. The program summary describes this as a significant security risk because it potentially allows unauthorised access to user credentials. It also notes that the API uses sequential numerical IDs, which makes user accounts susceptible to enumeration attacks.

The report does not include the request that produced the response, the response body, the hashing algorithm, or the number of records exposed. It also does not describe a fix, a bounty amount, or a timeline beyond the disclosure date of 26 November 2024. The severity recorded for the report is medium, with a CVSS score of 5.7, and the weakness is classified as information disclosure.

Root cause

The report does not state the root cause; it only says the endpoint returns sensitive user information, including hashed passwords.

The second contributing factor is the use of sequential numerical IDs as the lookup key. When the identifier is predictable, a caller can walk the range and collect a response for each account rather than needing to know a valid identifier in advance. The report presents both points together.

Impact

As the report frames it, the exposure potentially allows unauthorised access to user credentials. Hashed passwords are not plaintext, but they are the input to offline cracking: an attacker who collects many hashes can attempt to recover weak passwords at their own pace, without touching the target again. The sequential IDs compound this by making user accounts susceptible to enumeration attacks.

The report uses hedged language ("potentially allows"), and the practical impact depends on factors it does not state: the hashing algorithm and its cost, whether the endpoint required authentication, and whether other sensitive fields were returned alongside the hash. The severity recorded is medium, with a CVSS score of 5.7.

How this kind of bug works

Web frameworks commonly map a database row to a response object automatically. When the model contains a credential column, that column travels with the row unless the developer explicitly excludes it. The mistake is easy to make because the same model is often reused across many endpoints, and a field added later for internal use appears in every response that serialises the model.

Enumeration is a separate but related weakness. Identifiers that are sequential integers, or otherwise predictable, let a caller iterate over the identifier space. Even when each individual response is authorised, the predictability of the key means the caller can discover which identifiers exist and collect data at scale. Random, unguessable identifiers (UUIDs) raise the cost of enumeration but do not fix the underlying disclosure: the hash must not be in the response at all.

The standard defences are response schemas that whitelist fields, keeping credential columns out of any serialised view, and object-level authorisation checks so that a caller can only read records they are entitled to see. Rate limiting and unguessable identifiers reduce the speed and ease of enumeration but are secondary controls.

How to test for it

  1. Map the API surface. Look for endpoints that return user or profile objects: account details, public profiles, comments with author data, admin listings, export functions, and any endpoint that takes a user identifier as a path or query parameter.
  2. Capture a normal authenticated request and inspect the full response body, including nested objects and arrays, for fields whose names suggest credentials: password, password_hash, passwd, hash, salt, secret, token.
  3. Repeat the request with authentication removed, and with a lower-privileged account, to see whether the same fields are still returned.
  4. Vary the identifier. If IDs are sequential, request neighbouring values and confirm whether responses for other accounts are returned. Note whether the response differs for non-existent IDs, which reveals whether enumeration is possible.
  5. Record the exact request and response that demonstrate the disclosure, and note how many distinct accounts could be reached.

A positive result is a response containing a credential field for an account the caller should not be able to read, or for any account at all if the endpoint is unauthenticated. Common false positives include fields that look like hashes but are actually public identifiers, checksums, or opaque tokens with no credential value; a hash of an empty or placeholder value; and fields returned only to the account owner, which is expected behaviour. Confirm the value is a real password hash before reporting.

How it is fixed

  • Remove credential fields from every API response. Use explicit response schemas or serialisers that list the fields to return, rather than serialising the whole model.
  • Apply object-level authorisation so a caller can only read records they are entitled to, and return a generic not-found response for records they cannot access.
  • Replace sequential identifiers with unguessable ones where enumeration is a concern, and add rate limiting to endpoints that accept identifiers.
  • If hashes were exposed, treat it as a credential exposure: force password resets where appropriate and review the hashing algorithm and cost factor.

Hunting notes

This bug class tends to hide in endpoints added for convenience: mobile API versions that lag behind the web app, internal or admin endpoints reachable without the expected role, export and reporting functions, and older API versions kept alive for compatibility. Profile and comment endpoints that embed author objects are a frequent source, because the embedded object is serialised from the same model as the account record.

Recon signals worth following: API documentation or OpenAPI specs that list a user object schema, JavaScript bundles that reference fields not present in normal responses, and endpoints whose responses contain more fields than the UI displays. Sequential IDs in URLs are a strong signal that enumeration is worth testing.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 8 min read.

What happened, in plain words

This report is about a website and its API. An API is the part of a service that software talks to directly, rather than the pages a person clicks through in a browser. Think of a restaurant: the menu and dining room are the website, and the kitchen door where orders are passed through is the API. If the kitchen hands out the wrong thing through that door, anyone who knows how to knock can get it.

The target was the API of a Mars program asset, *.petpaw.com. The report is short, and the program summary hides the specific host and endpoint names, so the exact URL is not available here.

The finding is simple to state: an API endpoint returned sensitive user information, including hashed passwords, in its response. A hash is what you get when you run a password through a one-way mathematical function. You cannot read the password back out of it directly, but you can still use it, and the report explains why that matters below.

The program summary calls this a significant security risk because it potentially allows unauthorised access to user credentials. It also notes that the API uses sequential numerical IDs, which makes user accounts susceptible to enumeration attacks. A sequential numerical ID is an identifier like 1001, 1002, 1003: predictable, easy to guess, and easy to walk through one by one. Enumeration means exactly that, requesting one after another to see what comes back.

The report does not include the request that produced the response, the response body, the hashing algorithm, or the number of records exposed. It also does not describe a fix, a bounty amount, or a timeline beyond the disclosure date of 26 November 2024. The severity recorded for the report is medium, with a CVSS score of 5.7, and the weakness is classified as information disclosure. CVSS is a standard scoring system for how serious a flaw is; 5.7 sits in the medium band.

Root cause

The report does not state the root cause; it only says the endpoint returns sensitive user information, including hashed passwords. Serialising means turning an internal record into the text that gets sent back over the network. In everyday terms, the kitchen sends the whole stock list with every order instead of just the dish.

The second contributing factor is the use of sequential numerical IDs as the lookup key. When the identifier is predictable, a caller can walk the range and collect a response for each account rather than needing to know a valid identifier in advance. The report presents both points together.

Impact

As the report frames it, the exposure potentially allows unauthorised access to user credentials. Hashed passwords are not plaintext, but they are the input to offline cracking: an attacker who collects many hashes can attempt to recover weak passwords at their own pace, without touching the target again. Offline cracking means guessing passwords on your own computer and checking each guess against the stolen hash, with no rate limit or alarm to stop you. The sequential IDs compound this by making user accounts susceptible to enumeration attacks.

The report uses hedged language ("potentially allows"), and the practical impact depends on factors it does not state: the hashing algorithm and its cost, whether the endpoint required authentication, and whether other sensitive fields were returned alongside the hash. The severity recorded is medium, with a CVSS score of 5.7.

How this kind of bug works

In general, web frameworks commonly map a database row to a response object automatically. When the model contains a credential column, that column travels with the row unless the developer explicitly excludes it. The mistake is easy to make because the same model is often reused across many endpoints, and a field added later for internal use appears in every response that serialises the model.

Enumeration is a separate but related weakness. Identifiers that are sequential integers, or otherwise predictable, let a caller iterate over the identifier space. Even when each individual response is authorised, the predictability of the key means the caller can discover which identifiers exist and collect data at scale. Random, unguessable identifiers (UUIDs) raise the cost of enumeration but do not fix the underlying disclosure: the hash must not be in the response at all. A UUID is a long random-looking identifier, the opposite of 1001, 1002, 1003.

The standard defences are response schemas that whitelist fields, keeping credential columns out of any serialised view, and object-level authorisation checks so that a caller can only read records they are entitled to see. Rate limiting and unguessable identifiers reduce the speed and ease of enumeration but are secondary controls. Rate limiting means capping how many requests one caller can make in a given time.

How to test for it

In general, you can look for this kind of bug yourself with nothing more than a browser and its developer tools, which show the requests a page makes and the responses it gets back.

  1. Map the API surface. Look for endpoints that return user or profile objects: account details, public profiles, comments with author data, admin listings, export functions, and any endpoint that takes a user identifier as a path or query parameter. An endpoint is a specific address the API answers on; a query parameter is the part of a URL after the question mark that passes a value in.
  2. Capture a normal authenticated request and inspect the full response body, including nested objects and arrays, for fields whose names suggest credentials: password, password_hash, passwd, hash, salt, secret, token. A salt is random data mixed into a password before hashing so that identical passwords do not produce identical hashes.
  3. Repeat the request with authentication removed, and with a lower-privileged account, to see whether the same fields are still returned. Authentication is how the service knows who is asking, usually via a cookie or token, a small piece of proof the browser sends with each request.
  4. Vary the identifier. If IDs are sequential, request neighbouring values and confirm whether responses for other accounts are returned. Note whether the response differs for non-existent IDs, which reveals whether enumeration is possible.
  5. Record the exact request and response that demonstrate the disclosure, and note how many distinct accounts could be reached.

A positive result is a response containing a credential field for an account the caller should not be able to read, or for any account at all if the endpoint is unauthenticated. Common false positives include fields that look like hashes but are actually public identifiers, checksums, or opaque tokens with no credential value; a hash of an empty or placeholder value; and fields returned only to the account owner, which is expected behaviour. Confirm the value is a real password hash before reporting.

How it is fixed

  • Remove credential fields from every API response. Use explicit response schemas or serialisers that list the fields to return, rather than serialising the whole model.
  • Apply object-level authorisation so a caller can only read records they are entitled to, and return a generic not-found response for records they cannot access.
  • Replace sequential identifiers with unguessable ones where enumeration is a concern, and add rate limiting to endpoints that accept identifiers.
  • If hashes were exposed, treat it as a credential exposure: force password resets where appropriate and review the hashing algorithm and cost factor.

Hunting notes

In general, this bug class tends to hide in endpoints added for convenience: mobile API versions that lag behind the web app, internal or admin endpoints reachable without the expected role, export and reporting functions, and older API versions kept alive for compatibility. Profile and comment endpoints that embed author objects are a frequent source, because the embedded object is serialised from the same model as the account record.

Recon signals worth following: API documentation or OpenAPI specs that list a user object schema, JavaScript bundles that reference fields not present in normal responses, and endpoints whose responses contain more fields than the UI displays. Sequential IDs in URLs are a strong signal that enumeration is worth testing.

Glossary

  • API: the interface software uses to talk to a service directly, separate from the pages a person clicks.
  • Endpoint: a specific address on the API that answers a particular kind of request.
  • Request: the message a browser or tool sends to a server asking for something.
  • Response: the message the server sends back, including any data it returns.
  • Query parameter: a value passed in the URL after a question mark, often used to select a record.
  • Hash: the output of a one-way function applied to a password; you cannot read the password back out, but it can still be attacked offline.
  • Salt: random data mixed into a password before hashing so identical passwords do not produce identical hashes.
  • Sequential numerical ID: an identifier that counts up predictably, such as 1001, 1002, 1003.
  • Enumeration: requesting identifiers one after another to discover which exist and collect their data.
  • UUID: a long random-looking identifier that is hard to guess.
  • Serialisation: turning an internal database record into the text sent back over the network.
  • Mass assignment / over-serialisation: returning or accepting more fields than the caller should see or set.
  • Authentication: how a service knows who is making a request, usually via a cookie or token.
  • Authorisation: what an authenticated caller is allowed to do or read.
  • Object-level authorisation: checking that a caller may read this specific record, not just that they are logged in.
  • Information disclosure: a flaw that leaks data the caller should not receive.
  • Offline cracking: guessing passwords on your own machine and testing each guess against a stolen hash, with no rate limit.
  • Rate limiting: capping how many requests a caller can make in a given period.
  • CVSS: a standard scoring system for the severity of a security flaw.
  • False positive: something that looks like a flaw but is not one.

More from Mars

View all

The newest disclosed reports for this program.

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.