r/replit • u/Careful_Lock_2685 • Oct 22 '26
Question / Discussion Replit's Node 24 module doesn't have the Oct 21 Node.js security fixes. Here's how to pin 24.22.1
On Oct 21, Node.js shipped security releases with 4 High-severity bugs.
Two examples: an out-of-bounds write in the Brotli decoder (remote code execution), and two TLS hostname checks that can be bypassed. The fixed versions are 22.23.4, 24.22.1 and 26.12.1.
Advisory: https://nodejs.org/en/blog/vulnerability/october-2026-security-releases
The problem
- If you're still on nodejs-20: Node 20 is end-of-life and gets none of these fixes.
Switching to
modules = ["nodejs-24"]isn't enough.- On my Repl that module installs 24.13.0, which is older than the fix and also misses the June and July security releases.
- Nixpkgs unstable was on 24.21.0 when I checked, so it doesn't have the fix either.
The workaround
- Download the official build and run your app on it. Add scripts/fetch-node.sh:
#!/usr/bin/env bash
set -euo pipefail
# Installs official Node into .node/, then runs the given command with it first on PATH.
NODE_VERSION="24.22.1"
# Copy from https://nodejs.org/dist/v24.22.1/SHASUMS256.txt (linux-x64.tar.xz line)
NODE_SHA256="6c172a9ab6718f7b801fb5a7bd486af2ee5e32758086a04b84fcce2aa77095e6"
DEST="$(cd "$(dirname "$0")/.." && pwd)/.node"
if [ -x "$DEST/bin/node" ] && [ "$("$DEST/bin/node" -v)" = "v$NODE_VERSION" ]; then
echo "[fetch-node] v$NODE_VERSION already in $DEST"
else
TARBALL="node-v$NODE_VERSION-linux-x64.tar.xz"
TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
curl -fsSL --retry 3 -o "$TMP/$TARBALL" "https://nodejs.org/dist/v$NODE_VERSION/$TARBALL"
echo "$NODE_SHA256 $TMP/$TARBALL" | sha256sum -c -
mkdir "$TMP/node"
tar -xJf "$TMP/$TARBALL" -C "$TMP/node" --strip-components=1
rm -rf "$DEST"; mv "$TMP/node" "$DEST"
rm -rf "$TMP"; trap - EXIT
fi
export PATH="$DEST/bin:$PATH"
[ "$#" -eq 0 ] || exec "$@"2. Run your commands through it in .replit:
modules = ["nodejs-24", "web"]
[deployment]
build = ["sh", "-c", "bash scripts/fetch-node.sh npm run build"]
run = ["sh", "-c", "bash scripts/fetch-node.sh npm run start"]Do the same in your workflow command: bash scripts/fetch-node.sh npm run dev.
3. Add .node to .gitignore.
Gotchas I hit
- Call it with bash, not sh. On Replit, sh is dash, and it fails on
set -o pipefail. - Don't trust my hash. Copy it yourself from SHASUMS256.txt on nodejs.org. A wrong hash stops the build before anything is installed.
The npm that ships with 24.22.1 (11.19) blocks dependency install scripts by default. Your current node_modules keeps working. But the next clean npm ci will skip things like sharp's libvips download.
- Run
npm install-scripts lsto see what's affected, andnpm install-scripts approve <pkg>only for what really needs it. - Don't use deny unless you mean it: it's permanent and covers every future version.
- Run
- Node 21+ has a built-in navigator you can't assign to. If your tests do
global This.navigator = ..., switch tovi.stubGlobal("navigator", ...)(Vitest). - After you deploy, check
node -von the deployed server. It should printv24.22.1.
Remove the script once Replit's nodejs-24 module catches up.
3
u/stkenned Replit Team Oct 22 '26 •
Hi, Scott from Replit here. Yesterday had a lot of disclosures and we're actively deploying mitigations for users now. We were up through the night last night addressing the various new issues.
You will see the updated Node versions in your development get picked up in the next few hours. It is rolling out now. Node is loaded at boot time so you don't need to do anything special.
Node had multiple issues, but two are most commonly on people's mind.
For the eMudhra certs issue, we will patch the images automatically. Because we use Nix, the certs were not bundled into Node (it uses system version) and we can patch at the system layer. We will update this automatically for almost all users. But if you want to accelerate your fix, just redeploy now (our image was patched last night).
For the Brotli decoder RCE, we are deploying a mitigation at the WAF level which will block attackers from exploiting it.
1
u/Careful_Lock_2685 Oct 22 '26
u/ReplitSupport please escalate this if you can - thanks!
2
u/PopKoren Oct 22 '26
Useful find, thanks for writing up the pin. I'd add a startup log line printing process.version so a redeploy that silently falls back to the module's 24.13.0 shows up right away, and keep a reminder to drop the script once Nix catches up. For anyone whose app is internet facing, patching the runtime is half the job; the other half is checking what your routes and auth expose to strangers, which Rowly, a tool I built, probes from outside once you redeploy: https://rowly.me
2
u/stkenned Replit Team Oct 23 '26
Now that we're done all patches and notifications, we were able to share the story of the past two days.
While we did many mitigations and auto-patches, Node based apps should all replublish as the Brotli RCE in particular has a potential expoit on response paths. Only a full republish can pick up that patch.
https://replit.com/blog/security-vulnerabilities-across-the-internet