The Secret Every Browser Shared: How One Hardcoded HMAC Key Broke an Authentication Barrier
A browser's backend OCR service authenticated requests using an HMAC signing key that was identical across every browser installation, so anyone could generate valid signatures. A privileged browser extension also exposed the signing utility to web origins with weak origin validation, letting an unauthenticated attacker reach the OCR service and make it fetch external image URLs.
Published on gauravkdeore.medium.com
🔥 The Secret Every Browser Shared: How One Hardcoded HMAC Key Broke an Authentication Barrier
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 static HMAC signing key shared across all browser installations, combined with a browser extension that exposed the signing utility to web origins with flawed origin validation, and a backend that treated a valid signature as authentication.
Impact
An unauthenticated attacker could get the OCR service to process images and could make the backend fetch attacker-supplied URLs, giving a potential internal-reachability oracle; expired signatures were rejected, and no internal scanning was performed.
What the attacker needed
Ability to run the browser; a qualifying web origin; no account needed
The fix
The issue was fixed by replacing the shared static signing key with unique per-installation credentials, adding server-issued authentication, strengthening extension origin validation, and restricting server-side URL fetching.
How it was found
- Install the browser in two independent environments.
- Generate signatures for the same URL at the same timestamp in both.
- Observe that both installations produce identical signatures.
- Use the extension's signing utility from a qualifying web origin to create a fresh signature.
- Send a request to the OCR endpoint with the signature but no session cookies.
- Observe the backend processes the image and returns OCR results, and fetches an externally supplied image URL.
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.
An HMAC is a way to prove a message came from someone who holds a secret key, like a wax seal that only the key holder can make. Here every copy of the browser shipped with the same key, so anyone with the browser could make the same seal. The server checked the seal but not who sent it, so requests with no login were accepted.
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.