Skip to content
Access control Write-up Beginner

I Just Wanted a Cold Coffee. Instead I Found a Master Key to a Vending Machine Empire.

A hardcoded bearer token in a production JavaScript bundle granted unauthenticated access to multiple API endpoints, exposing corporate partner records, internal WiFi and MQTT credentials, and wallet balances. An attacker could use this token to retrieve sensitive data and potentially pivot onto the vending machine's internal network.

gokul965 Follow

Published on medium.com

Picture it. It’s evening.

Gokul, 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

Root cause

Likely a high-privilege authentication token was hardcoded into the client-side JavaScript bundle instead of being kept server-side and protected by proper authentication.

Impact

The token allowed unauthenticated access to corporate partner data, internal WiFi and MQTT credentials, and wallet balances, potentially enabling phishing and physical network access; the text notes the vendor fixed it quickly.

What the attacker needed

Access to the web app's JavaScript bundle; no authentication required

The fix

The token should be removed from client-side code and the sensitive logic moved server-side behind proper authentication; the text states the vendor fixed it.

How it was found

  1. Open the browser's developer tools and inspect the network tab while the vending machine web app loads.
  2. Locate the main JavaScript bundle and find the hardcoded authHeader value containing a bearer token.
  3. Use the token to call the employer endpoint and retrieve corporate partner records.
  4. Use the token to call the settings endpoint and obtain WiFi SSID, password, and MQTT broker address.
  5. Use the token to call the payment balance endpoint and view wallet credit.

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.

A developer left a secret password (a 'bearer token') inside the code that every visitor's browser downloads. Anyone who looked at that code could use the password to access private data and systems without logging in.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by gokul965

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.