When Ads Lie: How I Found a Click Fraud Weakness in a Major E-Commerce Site
A hardcoded JWT token was found in a production JavaScript file, allowing anyone to forge click and ad-click events sent to the site's fraud-detection partner. An attacker could flood the platform with fake events, skewing analytics and potentially causing financial damage or blocking real customers.
infosecwriteups.com
Published on infosecwriteups.com
FREE LINK
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 hardcoded JWT token was embedded in client-side JavaScript, exposing it to anyone who views the page source.
Impact
Attackers could poison analytics, cause financial damage by wasting ad budget, and risk real customers being auto-flagged and blocked due to polluted models.
What the attacker needed
Access to the public JavaScript file; no authentication needed
The fix
The token should be rotated, event handling moved server-side, payloads signed with a secret key, and ingestion hardened with origin validation and rate limiting.
How it was found
- Found a hardcoded JWT token in a production JavaScript file.
- Decoded the JWT to see it contained an account_id.
- Used the token to send a fake click event to the click endpoint.
- Used the token to send a fake ad-click event to the ad-click endpoint.
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 JWT is like a digital key that proves who you are. Here, the key was left in a public file, so anyone could use it to pretend to be the website and send fake clicks to an advertising fraud detector. This could mess up the detector's data and waste advertising money.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.