Skip to content
Leaked secrets Write-up Beginner

PII data exfiltration within minutes

A JWT with admin privileges was found in a public GitHub repository and was still valid on the company's API. An attacker could use it to access admin endpoints and exfiltrate employee and customer PII, including emails, phone numbers, and KYC status.

Mayank Garg Follow

Published on 0xmayankgarg.medium.com

Here I am with a story about one of my findings: I was able to exfiltrate complete PII data, not just of their customers but also of their employees’.

Mayank Garg, on 0xmayankgarg.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 a crypto exchange platform, described as a popular company in the US. Because the bug was not fixed at the time of writing, the author uses the alias crypto.com for the domain throughout. The main application is the crypto exchange platform itself, and the sensitive functionality in scope is the set of admin-only API endpoints that return employee data, customer data and transaction data.

From the original on 0xmayankgarg.medium.com

The author's stated goal was to exfiltrate complete PII, not only of customers but also of employees.

Setup

No accounts, roles or tool versions are described. The work was done over two days:

  1. Day one: reconnaissance on the main application, including subdomain enumeration, endpoint fuzzing and port scanning. A few low-hanging bugs were found, but the author wanted something of high severity.
  2. Day two: GitHub reconnaissance, followed by manual requests against admin endpoints.

Tools named in the report are GitHub search, jwt.io for inspecting the JWT structure, and cURL for issuing requests. The attack needed a valid JWT with admin privileges found in a public repository and admin endpoints that accepted it.

Finding it

On the second day the author started with GitHub recon. The report explains the idea plainly: companies develop products, developers write and collaborate on code on GitHub, and in doing so they often share confidential material such as passwords to live login pages or SSH servers, tokens and API keys.

From the original on 0xmayankgarg.medium.com

The search queries suggested in the report are:

Text
crypto.com token
crypto.com password
crypto.com "Authorization: Bearer"

The author formed the query crypto.com token and found a repository containing a JWT in the code. That JWT had admin privileges.

From the original on 0xmayankgarg.medium.com

To confirm the privilege level, the token was inspected with jwt.io, which shows the signing algorithm and the body (the actual data) of the JWT. The body contained the key-value pair:

Text
"authority": "ADMIN"
From the original on 0xmayankgarg.medium.com

The report adds a note that every piece of sensitive information found this way should be verified, because it may be a dummy token or password, or the company may already have nullified it.

Exploitation

Step 1: enumerate admin endpoints

The author looked for endpoints intended for admin users that required some form of authorisation, and found three such endpoints.

Step 2: replay the JWT

The token was sent to those endpoints by adding a header to the HTTP request:

HTTP
Authorization: Bearer <JWT_Token>

The token was accepted as valid and the responses contained massive data. The same request can be made with cURL:

Step 3: read the data returned by each endpoint

Endpoint Data returned
First endpoint PII of employees, including email addresses and phone numbers
Second endpoint PII of customers, including email addresses and phone numbers and whether their KYC is done
Third endpoint Transaction details: which cryptocurrency was bought, at what rate, and the transaction ID

The transaction data was massive and was refreshed after some time, because transactions took place at an extremely high rate. Exfiltrating this much data took around 15 to 20 minutes on the second day.

From the original on 0xmayankgarg.medium.com

Root cause

A JWT carrying the claim "authority": "ADMIN" was committed to a public GitHub repository, and the admin API endpoints accepted it as a valid credential. The report does not describe how the token was issued, how long it was valid, or whether any server-side check beyond signature and claim validation was performed. The report does not describe how the token was issued, how long it was valid, or what checks the server performed beyond accepting it.

Impact

With a single admin JWT, an attacker can read employee PII (email addresses and phone numbers), customer PII (email addresses, phone numbers and KYC status) and detailed transaction records (asset, rate, transaction ID). The transaction data was refreshed after some time, because transactions took place at an extremely high rate.

Fix

Reasonable remediation, not described in the report, would be to revoke the exposed token, remove the secret from the repository and its history, shorten the lifetime of admin tokens, and add controls that limit where an admin token can be used from.

Variants to test

  1. Search public repositories for the target's domain combined with token, password and Authorization: Bearer, as in the queries above. A positive result is a repository containing a credential that jwt.io decodes to a privileged claim such as "authority": "ADMIN".
  2. Decode any JWT found and check the claim names for role or authority fields. A positive result is a role value that maps to an admin or internal function.
  3. Replay the token against endpoints that require authorisation, starting with admin paths such as the orders list shown above. A positive result is a response containing data rather than an authentication error.
  4. Verify each candidate credential before reporting, since it may be a dummy or already revoked, as the report warns.

Outcome

Three to four days after reporting, the author was told the company had closed its bug bounty programme and would not pay. The company offered a Security Engineer role instead. The author declined because an internship at Deloitte USI was starting the following month, and took the internship.

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. 10 min read.

What happened, in plain words

A security researcher found a way to read the personal information of a crypto exchange company's customers and employees. The company is described as popular in the US. Because the bug was not fixed when the researcher wrote the story, the real domain is hidden and called crypto.com throughout.

The way in was a small piece of text called a token that a developer had left in a public code repository on GitHub. That token worked like an admin key: it let the researcher ask the company's servers for private data, and the servers answered. Within about 15 to 20 minutes on the second day of work, the researcher had pulled a large amount of data: email addresses and phone numbers of employees, email addresses, phone numbers and identity-check status of customers, and details of cryptocurrency trades.

From the original on 0xmayankgarg.medium.com

The researcher's stated goal was to exfiltrate complete PII, meaning personal data that identifies a person, not only of customers but also of employees.

The target and the first day

The target is a crypto exchange platform, a website and app where people buy and sell cryptocurrencies. The main application is the exchange itself. The author found three admin-only API endpoints that returned employee data, customer data and transaction data.

An API endpoint is a web address that a program, rather than a person clicking links, sends requests to. Think of it as a service counter: you ask for something specific at a specific window, and you get a specific answer. An admin endpoint is a counter meant only for staff, not for the public.

No accounts, roles or tool versions are described. The work was done over two days:

  1. Day one: reconnaissance on the main application, including subdomain enumeration, endpoint fuzzing and port scanning. A few low-hanging bugs were found, but the author wanted something of high severity.
  2. Day two: GitHub reconnaissance, followed by manual requests against admin endpoints.

Reconnaissance means looking around before attacking: finding out what exists, what is connected, and what might be weak. Subdomain enumeration is listing the smaller names under a company's main domain, like shop.example.com or api.example.com, because each one may be a separate system. Endpoint fuzzing is trying many possible web addresses quickly to see which ones answer. Port scanning is checking which network doors on a server are open, because each open door is a service that might be talked to. Low-hanging bugs are easy findings, often minor; high severity means a bug with serious consequences.

From the original on 0xmayankgarg.medium.com

Day two: looking on GitHub

On the second day the author started with GitHub recon. GitHub is a website where software developers store, share and collaborate on code. The report explains the idea plainly: companies develop products, developers write and collaborate on code on GitHub, and in doing so they often share confidential material such as passwords to live login pages or SSH servers, tokens and API keys.

An SSH server is a computer you can log in to remotely over an encrypted connection. A token is a short piece of text that acts like a key or a ticket: whoever holds it can prove to a server that they are allowed in, without typing a username and password. An API key is similar: a secret string that identifies a program to a service. If any of these end up in public code, anyone who finds them can try to use them.

From the original on 0xmayankgarg.medium.com

The search queries suggested in the report are:

Text
crypto.com token
crypto.com password
crypto.com "Authorization: Bearer"

These are search terms typed into GitHub's search box. The first looks for the company name next to the word token, hoping a developer wrote both near each other. The second does the same for the word password. The third looks for a standard phrase, Authorization: Bearer, which is how programs often send a token to a server; finding that phrase near the company name may reveal a working token. The quotes keep the phrase together so the search engine treats it as one unit.

The author formed the query crypto.com token and found a repository containing a JWT in the code. That JWT had admin privileges.

A repository is a project folder on GitHub. A JWT, short for JSON Web Token, is a token format made of three text parts separated by dots. The first part describes how the token is signed, the second carries the actual data, called claims, and the third is the signature that lets a server check the token was not altered. Admin privileges means the token is treated as belonging to an administrator, someone allowed to do and see everything.

From the original on 0xmayankgarg.medium.com

To confirm the privilege level, the token was inspected with jwt.io, which shows the signing algorithm and the body (the actual data) of the JWT. The body contained the key-value pair:

Text
"authority": "ADMIN"

This is a claim inside the token: a label authority with the value ADMIN. In plain words, the token says about itself that its holder is an administrator. The signing algorithm is the method used to produce the signature, so a server can tell whether the token is genuine.

From the original on 0xmayankgarg.medium.com

The report adds a note that every piece of sensitive information found this way should be verified, because it may be a dummy token or password, or the company may already have nullified it. A dummy is a fake value left for testing; nullified means cancelled or revoked, so it no longer works.

Exploitation

Step 1: enumerate admin endpoints

The author looked for endpoints intended for admin users that required some form of authorisation, and found three such endpoints. Authorisation here means the server checks that the caller is allowed in, usually by looking at a token or a login session.

Step 2: replay the JWT

The token was sent to those endpoints by adding a header to the HTTP request:

HTTP
Authorization: Bearer <JWT_Token>

An HTTP request is the message a browser or program sends to a server to ask for something. A header is a labelled line inside that message carrying extra information. This header is labelled Authorization, which tells the server "here are my credentials". The word Bearer means "the holder of this token is to be trusted", like a bearer bond: whoever physically holds it can cash it. <JWT_Token> is a placeholder where the actual token text goes.

The token was accepted as valid and the responses contained massive data. The same request can be made with cURL:

cURL is a command-line program for sending web requests. Line by line:

  • curl runs the program.
  • -X GET says the request method is GET, which is the method used to ask for data rather than to change it.
  • 'https://api.crypto.com/transaction/admin/orders/list' is the address being asked. The path contains admin, which signals it is meant for staff, and orders/list, which suggests it returns a list of orders or transactions.
  • -H "Authorization: Bearer <JWT_Token>" adds the header shown above, carrying the token.

Step 3: read the data returned by each endpoint

Endpoint Data returned
First endpoint PII of employees, including email addresses and phone numbers
Second endpoint PII of customers, including email addresses and phone numbers and whether their KYC is done
Third endpoint Transaction details: which cryptocurrency was bought, at what rate, and the transaction ID

PII means personally identifiable information: data that can point to a specific person, such as an email address or phone number. KYC means Know Your Customer, the identity checks financial companies are required to perform; whether KYC is done tells an outsider how thoroughly a customer has been verified. A transaction ID is the unique reference number of a trade.

The transaction data was massive and was refreshed after some time, because transactions took place at an extremely high rate. Exfiltrating this much data took around 15 to 20 minutes on the second day. Exfiltrating means copying data out of a system without permission.

From the original on 0xmayankgarg.medium.com

Root cause

A JWT carrying the claim "authority": "ADMIN" was committed to a public GitHub repository, and the admin API endpoints accepted it as a valid credential. The report does not describe how the token was issued, how long it was valid, or whether any server-side check beyond signature and claim validation was performed. The report does not describe how the token was issued, how long it was valid, or what checks the server performed beyond accepting it.

In simpler terms: the key was left in public, it was an admin key, and the server trusted it from anywhere. Binding a token to a client would mean making it work only from the device or program it was issued to. Short expiry would mean the token stops working after a brief time. An IP restriction would mean the token only works from certain network addresses. Detection would mean noticing the token being used from an unusual place.

Impact

With a single admin JWT, an attacker can read employee PII (email addresses and phone numbers), customer PII (email addresses, phone numbers and KYC status) and detailed transaction records (asset, rate, transaction ID). The transaction data was refreshed after some time, because transactions took place at an extremely high rate.

Fix

Reasonable remediation, not described in the report, would be to revoke the exposed token, remove the secret from the repository and its history, shorten the lifetime of admin tokens, and add controls that limit where an admin token can be used from. Revoking means cancelling the token so it stops working. Removing it from history matters because GitHub keeps old versions of files, so deleting the file alone may not hide the secret.

Variants to test

  1. Search public repositories for the target's domain combined with token, password and Authorization: Bearer, as in the queries above. A positive result is a repository containing a credential that jwt.io decodes to a privileged claim such as "authority": "ADMIN".
  2. Decode any JWT found and check the claim names for role or authority fields. A positive result is a role value that maps to an admin or internal function.
  3. Replay the token against endpoints that require authorisation, starting with admin paths such as the orders list shown above. A positive result is a response containing data rather than an authentication error.
  4. Verify each candidate credential before reporting, since it may be a dummy or already revoked, as the report warns.

Outcome

Three to four days after reporting, the author was told the company had closed its bug bounty programme and would not pay. A bug bounty programme is a scheme where a company offers rewards to people who report security bugs responsibly. The company offered a Security Engineer role instead. The author declined because an internship at Deloitte USI was starting the following month, and took the internship.

Glossary

  • API endpoint: a web address that programs send requests to, like a service counter for a specific task.
  • Admin endpoint: an API endpoint meant only for staff with administrator rights.
  • Reconnaissance: looking around a target to learn what exists before trying anything.
  • Subdomain enumeration: listing the smaller names under a main domain, such as api.example.com.
  • Endpoint fuzzing: trying many possible web addresses quickly to see which ones respond.
  • Port scanning: checking which network doors on a server are open.
  • Low-hanging bug: an easy-to-find, often minor security flaw.
  • High severity: a flaw with serious consequences.
  • GitHub: a website where developers store, share and collaborate on code.
  • Repository: a project folder on GitHub.
  • SSH server: a computer you can log in to remotely over an encrypted connection.
  • Token: a short piece of text that acts like a key or ticket, proving to a server that the holder is allowed in.
  • API key: a secret string that identifies a program to a service.
  • JWT (JSON Web Token): a token format with three dot-separated parts: header, claims and signature.
  • Claims: the data carried inside a JWT, such as a role or authority.
  • Signing algorithm: the method used to produce a token's signature so a server can check it is genuine.
  • Admin privileges: rights that allow full access, as an administrator.
  • Dummy: a fake value left for testing.
  • Nullified: cancelled or revoked, so no longer working.
  • Authorisation: the server checking that the caller is allowed in.
  • HTTP request: the message a browser or program sends to a server to ask for something.
  • Header: a labelled line inside an HTTP request carrying extra information.
  • Bearer token: a token where whoever holds it is trusted, like a bearer bond.
  • cURL: a command-line program for sending web requests.
  • GET: the HTTP method used to ask for data rather than change it.
  • PII: personally identifiable information, data that points to a specific person.
  • KYC: Know Your Customer, the identity checks financial companies must perform.
  • Transaction ID: the unique reference number of a trade.
  • Exfiltrating: copying data out of a system without permission.
  • Root cause: the underlying reason a vulnerability exists.
  • Credential: something that proves identity, such as a password or token.
  • Production: the live system real users use, as opposed to a test system.
  • Expiry: the time after which a token stops working.
  • IP restriction: limiting use of a token to certain network addresses.
  • Revoke: cancel a token so it stops working.
  • Remediation: the fix for a vulnerability.
  • 200 response: the standard web code meaning the request succeeded and here is the answer.
  • Bug bounty programme: a scheme where a company rewards people who report security bugs responsibly.

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.