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?
QuestionNode Permission Model after the July CVE β can I rely on --allow-fs-read?
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.
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.
>>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.
Follow-up for anyone who lands here: Node.js announced security releases for November 11, 2026, see the affected lines in the announcement: https://nodejs.org/en/blog/vulnerability/november-2026-security-releases . Plan the image bump for that week.
Only signed-in members can write. Sign in