The Cve That Punishes Good Developers
Axios merged request headers from the prototype chain without sanitising them, so a prototype pollution bug in any dependency could inject CRLF characters and smuggle a second HTTP request. An attacker could use this to reach the AWS metadata service, bypass IMDSv2 and steal IAM credentials.
Published on systemweakness.com
You’re a senior developer. You’ve been doing this for years.
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 Axios merged headers from the prototype chain and wrote them to the socket without rejecting carriage-return or line-feed characters.
Impact
An attacker could steal AWS IAM credentials and use them to read S3 buckets, spin up instances or pivot to other services; the text does not say whether IMDSv2 enforcement or a hop limit was in place to block it.
What the attacker needed
A prototype pollution bug in any dependency; app runs on AWS EC2 with an instance role; app uses a vulnerable Axios version
The fix
Axios was fixed in version 1.15.0 by rejecting header values that contain CRLF characters.
How it was found
- Pollute Object.prototype with a header value containing CRLF characters via a vulnerable dependency.
- Make a normal Axios request from the application.
- Axios merges the polluted property into the outgoing headers.
- The injected CRLF splits the request, smuggling a PUT to the AWS metadata service with the required TTL header.
- The metadata service returns a session token, which the attacker uses to obtain IAM credentials.
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 default properties from a shared parent object. If an attacker can add a property to that parent (prototype pollution), every object in the app gets it. Axios then copied those inherited properties into HTTP headers without checking for newline characters, letting an attacker insert a hidden second request to a sensitive internal address.
What is Smuggling / CRLF?
A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.