Skip to content
Info disclosure Write-up Intermediate

JS Analysis Leads to Information disclosure

The article describes multiple information disclosure issues: hardcoded API keys in JavaScript files, an exposed Laravel APP_KEY in a .env file, and a GraphQL endpoint with an unauthenticated operation that returned user details by phone number and another that listed all phone numbers. An attacker could use these to access sensitive data or perform unauthorised actions.

medium.com

Published on medium.com

Hey everyone, in this article, I’ve curated all the instances of PII and information disclosure through JS files. Hope you enjoy reading it.

Rahul Singh Chauhan, 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

Impact

The exposed keys could allow attackers to initiate transactions or manipulate payment functionalities, and the GraphQL operations could disclose user details and phone numbers without authorisation.

What the attacker needed

Access to the web application; Knowledge of GraphQL; A phone number for testing

The fix

The client removed the vulnerable GraphQL operations before launch, but other issues (hardcoded keys, exposed .env) should be fixed by removing secrets from client-side code and properly securing configuration files.

How it was found

  1. Inspect JavaScript files for hardcoded API keys.
  2. Find an exposed .env file containing the Laravel APP_KEY.
  3. Discover the GraphQL endpoint and run introspection to list operations.
  4. Invoke the exportBulkData operation with a phone number to retrieve user details.
  5. Use another query to fetch all phone numbers from the database.

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.

This write-up shows how secrets like API keys and encryption keys can be left in files that are sent to browsers or accidentally exposed. It also explains that a GraphQL API can have operations that do not check who is asking, letting anyone retrieve private information. The lesson is to search client-side code and configuration files for secrets and to test API operations for missing authorisation.

What is Info disclosure?

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

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.