Finding Data Leaks In Online Formatters
The online JSON formatter saves formatted data at URLs with a 6-digit hexadecimal ID, making saved content publicly accessible to anyone who guesses the ID. An attacker could brute-force or randomly guess these IDs to retrieve sensitive data such as personal information, credentials, and cryptocurrency wallet keystores.
Published on infosecwriteups.com
If you are a web developer, you may have used any online code formatter. There are hundreds of online code formatters for different purposes, such as formatting HTML, XML, JSON, etc.
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 formatter used a short, non-secret identifier for saved content and did not require authentication to access it, allowing enumeration.
Impact
An attacker could retrieve sensitive data such as personal information, credentials, and cryptocurrency wallet keystores, potentially leading to account compromise or financial loss.
What the attacker needed
Knowledge of the formatter's API; ability to send many requests
The fix
The formatter should require authentication to access saved content and use longer, unpredictable identifiers, or allow users to delete saved data.
How it was found
- Use Chrome Developer Tools to identify the API endpoints that save and retrieve JSON content.
- Copy the request to get saved content as cURL and import it into Postman.
- Add a Pre-request Script to generate a random 6-digit hexadecimal ID and store it in an environment variable.
- Replace the 'urlid' parameter in the request body with the generated ID.
- In the Tests section, check for a non-empty response and send it to a local ExpressJS API that stores it in MongoDB.
- Set the next request to the same request to create an infinite loop and run the collection with Newman with a two-second delay.
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 you use an online tool to format code, the tool may save your code on its website and give you a link. That link is public, so anyone who finds or guesses the link can see your code. Here, the links used short random-looking IDs, so someone could try many IDs to find other people's saved data.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.