Cybersecurity
Node.js flaw allowed code execution via crafted Brotli data
Imperva said it had shown code execution on an official Node.js 24.22.0 image by sending crafted Brotli data to the bundled decoder, after Node.js issued a fix on 21 October.
- Imperva said its proof of concept ran code on the official Node.js 24.22.0 Linux arm64 image by feeding crafted data into the bundled Brotli decoder.
- Node.js released fixes on 21 October, and the article said version 24.22.1 rejected the same input.
- Imperva said the result took several attempts on its Linux arm64 setup and that it had not tested other architectures or the 22.x and 26.x lines.
- The article said the flaw affected applications that decoded untrusted Brotli data, including through Node.js fetch responses and Express 5 or body-parser request parsing.
- Vercel said it added inbound-request rules on 21 October, but those did not cover Brotli responses and did not replace updating.
Imperva said it had demonstrated code execution on the official Node.js 24.22.0 image for Linux arm64 by supplying crafted Brotli data to the bundled decoder. The same input was rejected on Node.js 24.22.1.
The article said Imperva’s test did not work first time and required several attempts in its setup. It also said the result was limited to that build and environment, with other architectures and the 22.x and 26.x lines not checked.
According to the article, a previous public proof of concept only achieved execution on a deliberately weakened test build. On an ordinary build it produced a crash and a limited memory read, rather than code execution.
Imperva traced the issue to a point where the Brotli stream’s structure made the next block change impossible. The vulnerable decoder treated that state as a need for more input and continued, and a memory-sanitised run then showed an out-of-bounds write.
Node.js fixed the problem by taking an upstream Brotli patch that made the decoder stop with a format error at that point. The article said there was no workaround inside Node.js, so affected users were told to move to a patched release, while Imperva and Vercel both described additional filtering rules as partial measures only.
Named in this story
Companies
- Imperva
- demonstrated the proof of concept
- Vercel
- said it added inbound-request rules
Products and systems
- Node.js
- disclosed the flaw and released fixes
- Express 5
- decodes Brotli request bodies through its parsers
- body-parser
- decodes Brotli request bodies for routes
How the source tells it
The piece was a technical security advisory, with measured update guidance and little emotive framing.
No emotive framing was found in the original.