What happened
A flaw in the vm2 library allowed bypassing the require.root restriction with a symbolic link and loading code from outside the authorized directory. With the context: 'host' option, that code ran without isolation. The issue is already fixed.
Why it matters
The attack condition existed by default in many projects: pnpm, npm link and npm workspaces create symbolic links inside the root directory right after dependencies are installed. Code executed without isolation accesses the main process environment, outside the sandbox.
What to do
Update vm2 to the fixed version. Review whether the context: 'host' option is needed and check dependencies that create symbolic links in the root directory.
For the technical team
- CVE
- CVE-2026-43998
- Affected
- vm2 (biblioteca de sandbox para Node.js) · vm2 library, versions prior to the fix (source gives no version numbers).
- Exploitation
- No exploitation reported in the sources. A writeup published on dbugs details the bypass, tied to CVE-2026-43998.
- Fix
- Update vm2 to the fixed version; the source gives no version number.
- Vector
- isPathAllowed method in lib/resolver-compat.js: the path was built with path.resolve, which operates lexically and does not follow symbolic links, and validated with startsWith. Meanwhile, require called fs.realpathSync and resolved links before reading the file. A symbolic link inside the root directory passed the check; with context: 'host', the file executed in the host realm, without isolation through the bridge.
- More details
- Attack condition met by default in many projects: pnpm creates links from node_modules to the node_modules/.pnpm/ store, npm link points to a package's source directory and npm workspaces points to packages/ inside the monorepo. Example path that passes the check: node_modules/some-pkg/index.js. Related identifier: PT-2026-38389.
Timeline
A writeup on dbugs details the vm2 symbolic-link bypass, already fixed.
Sources 1 source
- @ptdbugs @ptdbugs


