Skip to content
Leaked secrets Write-up Beginner

How i got access to 1600k Users PII Data $$$$

A Zendesk API key was exposed in a publicly accessible JavaScript file, and it allowed unauthenticated access to the Zendesk users API, returning personal data for about 1.6 million users. An attacker could retrieve names, email addresses, phone numbers and other profile details of all those users.

Gokul AP Follow

Published on gokulap.medium.com

Bounty$1,500 View original

Hello Guys 👋 I am Gokul, Python developer, Cyber security researcher, Part time Bug hunter and Open source tool maker, Studying 3rd year Computer Science Engineering in Madurai, Tamilnadu !

Gokul AP, on gokulap.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target is referred to throughout as target.com. The feature involved is the site's login flow, but the vulnerability itself sits in a JavaScript file served by the application and in a third-party support platform, Zendesk, that the company used. Zendesk exposes a REST API under https://{target}.zendesk.com/api/v1/, and the /users.json endpoint returns user records. Normally that endpoint requires authentication, so an unauthenticated request should be rejected.

The weakness class is information disclosure: a credential embedded in client-side code gave read access to the Zendesk user directory.

Setup

The researcher was testing the login feature of target.com with Burp Suite, using Intercept, Repeater and Intruder. No special account, role or version is described. The only precondition that matters is that the application served a file named app.js, and that this file contained a JSON blob with configuration values, including a Zendesk URL, an FB App ID and an access token.

Finding it

The researcher was manipulating login requests in Burp and looking for sensitive actions or responses, without success. Instead of staying in the proxy tools, they opened the Burp HTTP History tab and scrolled through the logged URLs and responses. Nothing sensitive appeared in the JSON responses.

A request for /app.js stood out in the history. The reasoning was that most JavaScript bundles have hashed, unreadable names such as fabi65c78.js, while app is a conventional name for a main file, so it was worth reading. Scrolling through the source of that file revealed a JSON object containing a Zendesk URL, an FB App ID and an access token.

The FB App ID was initially suspected to be private, but research showed it is public data. The access token was more interesting: it was Base64 encoded. Decoding it produced a string of the form [redacted]/token:xxxxxxxx, which is an email address, a literal /token: separator and the token value. Using the Keyhacks repository to identify the format showed it was a Zendesk API key.

At this point the researcher had a key but did not know what Zendesk was or how the key was used, so they researched the platform to establish impact before reporting.

Exploitation

Step 1: find the users endpoint

Documentation for Zendesk showed the user listing endpoint:

Text
https://{target}.zendesk.com/api/v1/users.json

Step 2: request it without credentials

A plain request to the endpoint was made with curl:

Bash
curl https://{target}.zendesk.com/api/v1/users.json

The response confirmed that authentication is enforced:

JSON
{"error":"Couldn't authenticate you"}

Step 3: authenticate with the leaked key

JSON
{      "id": 123xxxxx,      "name": "Victim",      "email": "[redacted]",      "created_at": "2015-11-25T06:00:20Z",      "updated_at": "2015-11-25T06:00:20Z",      "time_zone": "Ekaterinburg",      "iana_time_zone": "Asia/Yekaterinburg",      "phone": xxxxxxxxxx,      "shared_phone_number": null,      "photo": null,      "locale_id": 1,      "locale": "en-US",      "organization_id": null,      "role": "end-user",      "verified": false,      "external_id": null,      "tags": [],      "alias": null,      "active": true,      "shared": false,      "shared_agent": false,      "last_login_at": null,      "two_factor_auth_enabled": false,      "signature": null,      "details": null,      "notes": null,      "role_type": null,      "custom_role_id": null,    } } "system::embeddable_last_seen": null....................    "count" : 1645729}

Each record carries personal data: name, email address, phone number, time zone, account role, verification state, whether two-factor authentication is enabled, and activity fields. The researcher describes the result as access to PII of around 16 lakh users.

Root cause

Base64 encoding was the only protection applied to it, and Base64 is an encoding, not encryption, so anyone reading the file could recover the key. The application's own authentication on the login feature was irrelevant, because the exposed credential belonged to a separate third-party service that trusted it on its own.

Impact

The researcher reports the figure as around 16 lakh users. The exposure is read access to PII through the Zendesk API; the report does not describe any write operations or other actions performed with the key.

Timeline

Stage Date
Reported March 6th 2022
Triaged March 10th 2022
Confirmation March 14th 2022
Bounty 1500 USD

Fix

The report does not state what the company changed. The fix implied by the finding is to remove the Zendesk API key from client-side JavaScript and rotate it, since a key served to browsers must be treated as public once it has been deployed.

Variants to test

  1. Read the main JavaScript bundles of a target, especially conventionally named files such as app.js, and search for JSON configuration blobs. A positive result is a block containing service URLs, app IDs or token-like strings.
  2. Decode any Base64 strings found in client-side code. A positive result is a readable credential format, for example an email address followed by a token, which can then be matched against a key-identification resource such as Keyhacks.
  3. For any support-desk or CRM host discovered in that configuration, request its user listing endpoint without credentials, then with the recovered key. A positive result is an authentication error on the first request and a JSON collection with a count field on the second.
  4. Review Burp HTTP History rather than only the active proxy tools, looking for responses and static files that were loaded incidentally. A positive result is a file or response that was not part of the tested feature but contains configuration or credentials.

Tips from the report

  1. Always check Burp history.
  2. Do not report as soon as you find something; increase the impact first, then report.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

What happened, in plain words

A security researcher was testing the login page of a company's website (called target.com in the write-up). While looking through the list of every request his browser had made, he noticed a file called app.js. That file contained a hidden piece of text that worked like a password for a separate customer-support service the company used, called Zendesk. He reported it and received a $1,500 bounty.

This article walks through exactly how he did it, step by step, explaining every technical term along the way.

Background: what is Zendesk and why does it matter?

Zendesk is a customer support platform: companies use it to manage help tickets, chat with customers, and store user records. It has an API (Application Programming Interface), which is a way for computer programs to talk to it directly, like a waiter taking your order to the kitchen. The API lets you read or change data without using the normal website interface.

The specific API endpoint used here is:

Text
https://{target}.zendesk.com/api/v1/users.json

Normally, you need to be logged in (authenticated) to see it.

The setup: tools the researcher used

The researcher used a tool called Burp Suite, which is a kind of eavesdropping proxy for web traffic. It sits between your browser and the website, letting you see and modify every request and response. He was specifically using three parts of Burp:

  • Intercept: pauses each request so you can change it before it is sent.
  • Repeater: lets you send the same request over and over with small changes.
  • Intruder: automates sending many requests with different values (like a brute-force attack).

He was testing the login feature, trying to find bugs related to session management (how the website remembers who you are after you log in) and logical errors (flaws in the business rules, like being able to skip a step).

Finding the hidden key

After manipulating login requests without success, he decided to look at the HTTP History tab in Burp. This tab logs every single request and response that passed through the proxy, like a browser's history but with full details. He scrolled through and saw many JSON responses (JSON is a common text format for data, like a structured list). Nothing sensitive there.

Then he spotted a request for /app.js. Most JavaScript files have random names like fabi65c78.js, but app.js is a common name for the main file of a web application. He decided to read its source code.

Inside that file, he found a block of JSON containing configuration values: a Zendesk URL, an FB App ID (Facebook Application ID, which is a public identifier for a Facebook app, not a secret), and an access token.

An access token is like a temporary password or a key card: it proves to the server that you are allowed to access something. This token was Base64 encoded. Base64 is a way of turning any data into plain letters and numbers so it can be safely sent as text. It is not encryption; anyone can decode it. When he decoded it, he got a string that looked like:

Text
[redacted]/token:xxxxxxxx

That is an email address, then the literal text /token:, then the actual token value. He then used a public repository called Keyhacks (a collection of ways to test if a leaked key is valid) to identify the format. It matched a Zendesk API key.

At this point he had a key but did not know what Zendesk was or how to use the key. So he researched Zendesk's documentation to understand the impact before reporting.

Exploiting the key

Step 1: find the users endpoint

From Zendesk's documentation, he learned that the endpoint to list users is:

Text
https://{target}.zendesk.com/api/v1/users.json

Step 2: request it without credentials

He first tried to access it without any authentication, using the command-line tool curl (a program that sends HTTP requests from a terminal):

Bash
curl https://{target}.zendesk.com/api/v1/users.json

This line sends a simple GET request to that URL. The response was:

JSON
{"error":"Couldn't authenticate you"}

This confirmed that the endpoint requires authentication: without a key, you get an error.

Step 3: authenticate with the leaked key

Then he sent the same request but included the API key using curl's basic authentication option (-u):

JSON
{      "id": 123xxxxx,      "name": "Victim",      "email": "[redacted]",      "created_at": "2015-11-25T06:00:20Z",      "updated_at": "2015-11-25T06:00:20Z",      "time_zone": "Ekaterinburg",      "iana_time_zone": "Asia/Yekaterinburg",      "phone": xxxxxxxxxx,      "shared_phone_number": null,      "photo": null,      "locale_id": 1,      "locale": "en-US",      "organization_id": null,      "role": "end-user",      "verified": false,      "external_id": null,      "tags": [],      "alias": null,      "active": true,      "shared": false,      "shared_agent": false,      "last_login_at": null,      "two_factor_auth_enabled": false,      "signature": null,      "details": null,      "notes": null,      "role_type": null,      "custom_role_id": null,    } } "system::embeddable_last_seen": null....................    "count" : 1645729}

Each record includes personal data: name, email address, phone number, time zone, role, whether the account is verified, whether two-factor authentication is enabled, and other fields. The researcher describes this as access to PII (Personally Identifiable Information) of around 16 lakh users (1 lakh = 100,000, so 16 lakh = 1.6 million).

Why this happened (root cause)

The only protection was Base64 encoding, which is easily reversed. Anyone who viewed the file could decode the key. The company's own login system was irrelevant because the key belonged to a separate service (Zendesk) that trusted it independently.

Impact

The researcher reports the figure as around 16 lakh users. The exposure is read access to PII through the Zendesk API; the report does not describe any write operations or other actions performed with the key.

Timeline

Stage Date
Reported March 6th 2022
Triaged March 10th 2022
Confirmation March 14th 2022
Bounty 1500 USD

Fix

The report does not state what the company changed. The fix implied by the finding is to remove the Zendesk API key from client-side JavaScript and rotate it, since a key served to browsers must be treated as public once it has been deployed.

Variants to test

  1. Read the main JavaScript bundles of a target, especially conventionally named files such as app.js, and search for JSON configuration blobs. A positive result is a block containing service URLs, app IDs or token-like strings.
  2. Decode any Base64 strings found in client-side code. A positive result is a readable credential format, for example an email address followed by a token, which can then be matched against a key-identification resource such as Keyhacks.
  3. For any support-desk or CRM host discovered in that configuration, request its user listing endpoint without credentials, then with the recovered key. A positive result is an authentication error on the first request and a JSON collection with a count field on the second.
  4. Review Burp HTTP History rather than only the active proxy tools, looking for responses and static files that were loaded incidentally. A positive result is a file or response that was not part of the tested feature but contains configuration or credentials.

Tips from the report

  1. Always check Burp history.
  2. Do not report as soon as you find something; increase the impact first, then report.

Glossary

  • API: Application Programming Interface; a set of rules that lets programs talk to each other, like a menu and waiter in a restaurant.
  • Base64: A method of encoding binary data as text using 64 characters; it is not encryption and can be easily decoded.
  • Burp Suite: A tool for intercepting and modifying web traffic between a browser and a server.
  • curl: A command-line tool for sending HTTP requests.
  • Endpoint: A specific URL where an API can be accessed.
  • FB App ID: Facebook Application ID; a public identifier for a Facebook app, not a secret.
  • HTTP History: A log in Burp Suite of all requests and responses that passed through the proxy.
  • Information disclosure: A vulnerability where sensitive information is exposed to unauthorised parties.
  • JSON: JavaScript Object Notation; a lightweight text format for structured data.
  • Keyhacks: A public repository of techniques to test if a leaked key is valid.
  • PII: Personally Identifiable Information; data that can identify an individual, such as name, email, phone number.
  • Session management: How a website tracks a user's logged-in state across requests.
  • Token: A piece of data used for authentication, like a temporary password or key card.
  • Zendesk: A customer support platform that provides an API for managing user records and tickets.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.