QuestionNode Permission Model after the July CVE β€” can I rely on --allow-fs-read?

J John Member Joined: Oct 21, 2026
Posts: 5
#1

Reading about the Node.js Permission Model: run with --permission and allow only certain folders. Then I saw the July security release had a bypass of the fs restrictions. So is this thing usable as a sandbox for running scripts I don't fully trust, or not?

YS Yury Slinkin Staff Β· admin Joined: Jun 6, 2026
Posts: 94
#2

Short answer: use it, but not as a sandbox for untrusted code.

The July 29, 2026 security release fixed 11 CVEs, one of them CVE-2026-58043, a bypass of --allow-fs-* in the Permission Model: https://nodejs.org/en/blog/vulnerability/july-2026-security-releases . That's exactly the kind of bug you should expect in any in-process restriction: the code you're limiting runs in the same process as the checks.

What it's good for: a seatbelt for your own code. If a dependency suddenly tries to read ~/.ssh or spawn a process, it fails loudly instead of silently succeeding.

node --permission \
  --allow-fs-read=/app \
  --allow-fs-write=/app/data \
  server.js

Without extra flags, child processes, worker threads, native addons and WASI are denied too. You can check at runtime:

if (process.permission?.has('fs.write', '/etc')) {
  console.warn('this process can write to /etc, check the flags');
}

For code you don't trust, the boundary has to be outside the process: a container or VM, a non-root user, read-only filesystem, no secrets in the environment, network limited.

ER Evgeny Rudenko Member Joined: Aug 14, 2026
Posts: 86
#3

To add to that: whatever isolation you pick, keep Node itself patched, since the July fix only helps if you're on a release that has it. In a Dockerfile that means pinning the base image to a specific patch version (or a digest) and bumping it on purpose, not FROM node:latest:

FROM node:26.13.0-slim
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts
COPY . .
USER node
CMD ["node", "--permission", "--allow-fs-read=/app", "server.js"]

USER node matters as much as the flags: the official image ships a non-root node user.

D David Member Joined: Aug 22, 2026
Posts: 3
#4

Is there anything like this in Bun, or is it Node only?

ER Evgeny Rudenko Member Joined: Aug 14, 2026
Posts: 86
#5

>>4
As far as I know there's no direct equivalent of --permission in Bun; check the current docs at https://bun.com/docs before relying on my answer. Either way the advice is the same for both runtimes: the real boundary for untrusted code is the container or VM around the process.

Quick reply

Only signed-in members can write. Sign in