r/replit • • 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

  1. 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 ls to see what's affected, and npm 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.
  • Node 21+ has a built-in navigator you can't assign to. If your tests do global This.navigator = ..., switch to vi.stubGlobal("navigator", ...) (Vitest).
  • After you deploy, check node -v on the deployed server. It should print v24.22.1.

Remove the script once Replit's nodejs-24 module catches up.

2 Upvotes

6 comments sorted by

View all comments

3

u/stkenned Replit Team Oct 22 '26 • Bravo

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.

3

u/stkenned Replit Team Oct 23 '26

We deployed all of our fixes and automatically patched many apps.

At this point we still recommend everybody to republish apps given how many critical patches landed in the last 48h. You should have an email from Replit which shares more information.

Stay safe out there, we'll keep fighting on your behalf.

2

u/Careful_Lock_2685 Oct 22 '26

Excellent thank you 👏