vm2 · Disclosed

vm2 require.root bypass via symbolic link is fixed

· 1 min read

vm2's require.root check compared only path strings, so a symbolic link inside the allowed root passed the check and loaded a file from outside; with context: 'host', the code ran without isolation. Package managers such as pnpm, npm link and npm workspaces create such links by default. The flaw (CVE-2026-43998) is fixed; update the library.

WhatsApp LinkedIn X
HighVulnerabilityDisclosedPatched
In this article
  1. What happened
  2. Why it matters
  3. What to do
  4. For the technical team
  5. Timeline
  6. Sources

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.

Incidents like this, every morning

The ones that need action first, in a 3-minute read.

Free · 1 email a day, in the morning · no spam, unsubscribe in 1 click

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

  1. A writeup on dbugs details the vm2 symbolic-link bypass, already fixed.

Sources 1 source

Get the next one tomorrow morning

One email a day with what changed, what to fix first and how.

Free · 1 email a day, in the morning · no spam, unsubscribe in 1 click

Share it with your team

Whoever handles security with you should get it too.

LinkedIn X

Your colleague gets a confirmation request. Nothing is sent unless they confirm.

See all news

Read also

Before you go: get this every day

The HIFY Radar daily edition lands every morning with the incidents that need action. Free.

Free · 1 email a day, in the morning · no spam, unsubscribe in 1 click