$175 Prototype Pollution Vulnerability — My first bounty
A redeem-code endpoint accepted JSON that could pollute the JavaScript object prototype, causing the server to treat an invalid code as valid. The attacker could add in-game currency to their wallet and claim a free pass to a paid game, though only once per account.
medium.com
Published on medium.com
Hey everyone, I’m excited to be back with another write-up! I’m a 19-year-old BCA student with a passion for bug hunting and cybersecurity.
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 the server merged user-supplied JSON into an object without filtering special keys such as __proto__, allowing prototype pollution that interfered with the code comparison.
Impact
An attacker could add in-game currency and claim a free paid-game pass, but only once per account and without controlling which reward is redeemed.
What the attacker needed
A free account; access to the redeem code feature
How it was found
- Find the redeem code functionality and submit a random code to capture the request.
- Observe that the code is sent as JSON in the request body.
- Send a JSON body where the code field contains a __proto__ object with a property.
- Receive a successful response and see 1500 CRYSTALS added to the wallet.
- Create another account and repeat to claim a free pass to a paid game.
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.
JavaScript objects inherit shared properties from a 'prototype'. If an attacker can add properties to that shared prototype, every object may pick them up. Here, sending a crafted JSON body to a redeem-code endpoint apparently changed how the server checked codes, so an invalid code was accepted.
What is Prototype pollution?
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.