php2shell and Node Brotli RCE: the version string lies
PHP and Node.js both released fixes for unauthenticated remote code execution flaws. In PHP, an out-of-memory abort unwound past request initialisation and shutdown ran on half-built structures, while in Node's vendored Brotli decoder a discarded error return let decoding continue on an invalid block index.
medium.com
Published on medium.com
Probe for Brotli error -17 and read the distro changelog: php2shell patches land as 8.3.6–0ubuntu0.24.04.13, and Bun’s newest tag is unpatched.
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 failure signal raised by one function was discarded by its caller, so execution continued on invalid state instead of aborting.
Impact
An attacker could achieve remote code execution without authentication, though on PHP only Apache mod_php is marked validated over HTTP while other SAPIs are susceptible from source analysis with no completed exploit published.
What the attacker needed
Malformed input reaches a parser; for Node: fetch() or body-parser with raw()/json(); for PHP: default settings on mod_php
The fix
PHP removed longjmp() from the out-of-memory path in favour of a delayed soft OOM at the next VM safe point and a hard OOM via _exit(), and Node's Brotli commit added a macro that preserves the returned status and jumps to saveStateAndReturn at all three block-switch call sites.
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.
Both PHP and Node.js had bugs where a function noticed something was wrong but the code that called it ignored the warning and carried on. In PHP, running out of memory left the program in a broken state that it then tried to clean up, and in Node a compressed data stream that should have been rejected was decoded anyway. An attacker could send crafted input to trigger these paths and potentially run their own code on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.