Skip to main content
Platform security guideReviewed

Node.js security vulnerabilities: what the runtime fixes, what npm brings in, and how to triage both

A Node.js application takes on flaws from the runtime release it runs on, from the npm packages it installs and from its own code.

This guide shows which release lines receive security fixes, what the Node.js threat model leaves to you, and how to triage install scripts, lockfile drift, native modules and provenance changes, with a worksheet and an offline lab you can run.

Node.js runtime and dependency triage worksheet with an offline lab

A six-section worksheet that keeps Node.js release support, package advisories, lockfile drift, install scripts, native modules and provenance changes apart, names the Node.js or npm source for each line that relies on one, and gives every finding an owner. A worked example for an invented application follows, then an offline lab whose four files and outputs were copied in from a real run.

nodejs.txt

Introduction15 lines

NODE.JS RUNTIME AND DEPENDENCY TRIAGE WORKSHEET, WORKED EXAMPLE AND OFFLINE LAB ILLUSTRATION AND TEMPLATE. Part A is a blank worksheet to copy into a ticket or a spreadsheet. Part B fills it in for an invented application, lab-invented-app, using the Node.js release schedule and the Node.js security release post of 11 November 2026 as read on 14 November 2026, and the output of the lab in Part C. The environments, people, roles and dates in Part B are invented. Part C is an offline lab that installs invented packages from local files and contacts no registry. Every check in Part A is read-only and is run by the application's owner or their developer on systems they control. Nothing in it asks you to change a setting, install or upgrade anything, rotate or reveal a secret, or send traffic to a service you do not own. Where a source describes a step that changes your system, such as npm rebuild, the worksheet names it and leaves it for a separate, planned change. Record the names of environment variables and secrets, never their values. HOW TO FILL IT - Use one copy per application. Fill section 1 once for each environment the application runs in: each developer machine image, each CI or build image, and production. Environments drift apart, so one reading does not speak for another. - Where you cannot answer a line, write "unknown". It goes on the findings log as something to find out. - Each finding gets one line in the findings log at the end, with an owner. The owner is the person who can make the change, who may not be the person who found it. - "Source" names the page that says where to look or what a value means. "This page's advice" marks a practice this guide recommends, not a rule from Node.js or npm. Application: Commit or build checked: Completed by (name and role): Date:

Node.js security vulnerabilities: the runtime, or the code it runs

Node.js is the runtime under a JavaScript server application.

It parses the requests your server receives, runs your code and the framework it is built on, and loads the npm packages your code imports. A Node.js security vulnerability can mean two different things: a flaw in the runtime itself, which the Node.js project fixes in a security release, or a flaw in your own code or in a package you installed, which upgrading Node.js does not touch.

The project's security policy draws the line between the two in its threat model, and it is worth knowing where the line falls before reading any advisory.

The threat model lists what Node.js does not trust. First on the list is data from the remote end of inbound network connections that are accepted through Node.js APIs and transformed or validated by Node.js before being passed to your application, which includes the HTTP server APIs.

The policy says that if data passing through Node.js to or from the application can trigger actions other than those documented for the APIs, there is likely a security vulnerability. On the other side, Node.js trusts the code it is asked to run: JavaScript, WASM and native code, including every dependency installed from the npm registry, and that code inherits all the privileges of the user running it. It also treats the operating system and the file system it can reach as trusted.

The policy spells out what follows. A scenario that needs a malicious third-party module cannot be a Node.js vulnerability. Prototype pollution that depends on control over user input is not one either, because Node.js trusts the inputs application code gives it. Exposing child_process.exec() to untrusted users without input validation, and letting untrusted users control file paths passed to file system APIs without validation, are listed as application-level issues, and a crash caused by a missing 'error' handler is not a denial-of-service vulnerability in Node.js.

This page's reading of that list: upgrading Node.js closes the runtime flaws the new release fixes, and nothing else. The rest sits with the application's owner, in six places the worksheet on this page keeps apart: the release line you run, advisories against your packages, lockfile drift, install scripts, native modules and provenance changes.

Command injection through child processes and path traversal through file APIs each have their own guide, and the Express guide covers middleware order in Express applications.

Which Node.js release lines receive security fixes

Node.js ships in release lines, one per major version.

The Node.js Releases page says a major version spends six months with Current status, which gives library authors time to add support for it. Up to Node.js 26, odd-numbered releases became unsupported after six months and even-numbered ones moved to Active LTS. From Node.js 27 the cycle is annual, and every major version moves to LTS after six months as Alpha and six as Current.

The page describes LTS as long-term support under which critical bugs are typically fixed for a total of 30 months, and it says production applications should only use Active LTS or Maintenance LTS releases.

Statuses move on a schedule, so read them on the day you check. On 14 November 2026, the release schedule the Node.js Release working group keeps on GitHub listed 26.x as Active LTS, 24.x and 22.x as Maintenance LTS, and 27.x in its Alpha phase.

It gave end-of-life dates of 30 April 2029 for 26.x, 30 April 2028 for 24.x and 30 April 2027 for 22.x, and listed 20.x and 25.x as already end-of-life, from 30 April 2026 and 1 June 2026. The schedule notes that its dates are subject to change.

It describes the Maintenance phase, which applies to lines up to Node.js 26, as critical bug fixes and security updates, and says Alpha releases are intended for library authors and CI pipelines, not for production use.

For security, end-of-life is the status to watch. The Node.js end-of-life page says a version that reaches it no longer receives updates, including security patches, and that when a security release fixes a flaw in newer lines, there will be no new release for an end-of-life line even if the same flaw affects it.

The security release post of 11 November 2026 says end-of-life versions are always affected when a security release occurs. This page's advice is to log an end-of-life line in production as a finding in its own right, whether or not an advisory names it.

Two quick reads show where an environment stands. node --version prints the version it runs. node -p "process.release.lts" prints the line's codename on an LTS release, and the Node.js process documentation says the property is undefined for every other release type, including Current releases. In the lab on this page it printed undefined on Node.js v26.0.0, although the schedule gives the 26.x line an Active LTS start of 28 October 2026; the process documentation describes the property as the LTS label for the release itself. package.json can also declare a Node.js range in its engines field. npm's documentation says that, unless the engine-strict config flag is set, the field is advisory only and will only produce warnings when the package is installed as a dependency.

The lab shows npm warning about a range the running Node.js did not meet, installing the package anyway, and refusing it once engine-strict was on.

How Node.js announces a security release, and how to read one

The Node.js security reporting page sets out the disclosure process.

A reported problem is validated against all supported Node.js versions, and fixes are prepared for all supported releases. On the embargo date the announcement goes to the Node.js security mailing list, new builds are deployed to nodejs.org, and a copy of the advisory is published on the Node.js blog within six hours of the mailing list being notified.

The project's security policy names two places to watch: the nodejs-sec Google Group and the Vulnerabilities category of the Node.js blog. It also notes a built-in delay between a security release and the public disclosure of its CVEs.

This page's reading is that a CVE database can trail the release that fixes a flaw, so read the blog post rather than wait for the CVE record.

Take the post of 11 November 2026, read on 14 November 2026, as a worked example. It announced updates for the 26.x, 24.x and 22.x lines and lists Node.js v26.13.1, v24.22.3 and v22.23.5 under its downloads and release details. It also lists dependency updates: llhttp on all three lines, undici on 24.x and 26.x, and sqlite on 22.x and 24.x.

The highest severity it gives for each line is HIGH. It lists no release for 20.x or 25.x, which the schedule already showed as end-of-life.

Three of its entries show how much the detail matters. CVE-2026-123864, rated high, is a flaw in Node.js HTTPS that lets an unauthenticated client read memory belonging to other connections, including TLS private keys and other users' requests. The post says triggering it requires a handler that calls res.flushHeaders() before the request body ends and later calls res.end() with a non-empty chunk, that reading the leaked memory requires any ordinary route that echoes or stores a request body, and that cleartext node:http is not affected.

CVE-2026-123871, rated medium, is Node.js disclosing proxy credentials in ERR_PROXY_INVALID_CONFIG error messages, which the post notes reach a much wider audience than the process environment, such as stderr, container logs, log aggregation and crash reporting services.

CVE-2026-106071, rated low, lets a wildcard --allow-fs-read or --allow-fs-write rule in the permission model match paths it should not, where the wildcard grant sits directly under the root of the permission tree. The post lists all three as affecting 22.x, 24.x and 26.x.

The conditions in an entry help you judge urgency and decide where to look for signs of earlier exposure, which is this page's advice. The fix the post offers is the new release. Record the release each post lists for your line in section 1 of the worksheet, and compare it with what each environment runs.

This account is as of 14 November 2026. Newer posts appear in the Vulnerabilities category of the Node.js blog and on the nodejs-sec mailing list.

When a post names a dependency update, node -p "process.versions" lists the versions of Node.js and its dependencies in the environment you run it in.

Start-up flags and environment variables that change the runtime's exposure

An exposed inspector can let someone run code inside your process.

The Node.js command-line documentation gives --inspect a default of 127.0.0.1:9229 and warns that binding it to a public IP, including 0.0.0.0, with an open port is insecure, because it allows external hosts to connect and perform a remote code execution attack.

The debugging guide adds that even on 127.0.0.1, any application running locally has unrestricted access, by design. The security best practices page lists not running the inspector protocol in production among its mitigations for DNS rebinding.

Flags do not always appear in the start command. The command-line documentation describes NODE_OPTIONS as a space-separated list of options that are interpreted before the command-line options. This page's advice follows from that: read NODE_OPTIONS in each environment as well as the start command.

The same documentation says that setting NODE_TLS_REJECT_UNAUTHORIZED to 0 disables certificate validation for TLS connections, and it strongly discourages using the variable. The HTTP request smuggling guide covers --insecure-http-parser.

Experimental flags carry a different promise. The security best practices page says using experimental features in production isn't recommended, because they can suffer breaking changes and their functionality isn't securely stable. The security policy adds that a flaw affecting only an experimental feature at stability 1.0 or 1.1, gated behind an --experimental- runtime flag, will not be accepted as a valid security issue unless it can be exploited in a way that affects the security of a stable feature when the flag is not enabled.

One hardening flag the best practices page suggests sits in this group: --frozen-intrinsics, against monkey patching, which the command-line documentation marks Stability 1, Experimental.

The permission model is the runtime's own restriction feature, and its documentation marks it Stable from Node.js 23.5.0 and 22.13.0. Started with --permission, a process is restricted in its access to the file system through the fs module, the network, child processes, worker threads and native addons, among other things, until each is granted back with an --allow flag.

The documentation calls it a seat belt that prevents trusted code from unintentionally using resources it was not granted, and says it does not protect against malicious code.

The security policy says it is designed to reduce the blast radius of mistakes in trusted application code, not to act as a security boundary against intentional misuse. Two fixes in the November 2026 post, CVE-2026-106071 and CVE-2026-123829, were in the permission model itself, so this page treats it like the rest of the runtime: it is only as current as the release you run. The remote code execution guide shows the model at work in a lab.

Where npm brings risk into a Node.js application

The threat model gives every package npm installs the same trust as your own code.

Four parts of the npm workflow decide what reaches the application and what runs on the machines that install it, and each has its own section in the worksheet.

Package advisories

npm audit submits a description of the project's dependencies to the default registry and asks for a report of known vulnerabilities; given the fix argument, it also applies remediations to the package tree. The dependency security guide covers reading each advisory against your own code and deciding what to update first, and the SBOM guide covers recording what each release contains.

Lockfile drift

Run without arguments, npm install keeps the lockfile's versions while they satisfy the ranges in package.json, and when they do not, it resolves new versions and updates the lockfile. npm ci exits with an error instead of updating the lockfile when the two disagree, and never writes to either file.

A lockfile entry records the version, the address it was resolved from and an integrity value. It can also carry a hasInstallScript flag, the engines field from the package's own package.json, and os and cpu fields where the package specifies those restrictions.

The lab's drift report compares those fields between a lockfile someone reviewed and the one about to be deployed.

Install scripts

A package can declare preinstall, install and postinstall scripts, and the lockfile flags such a package with hasInstallScript. Among the best practices in npm's scripts documentation, compilation which must be done on the target architecture is named as the only valid use of install or preinstall scripts. Whether npm runs a dependency's script by default depends on the npm version, which the supply chain attacks guide sets out.

The lab ran on npm 11.12.1: npm ci ran both invented install scripts, each could read a variable set on the npm command line, and with --ignore-scripts neither ran.

Provenance changes

npm provenance publicly provides a link to a package's source code and build instructions from the build environment, and npm audit signatures checks registry signatures and provenance attestations, returning an error if a package has missing or invalid signatures or attestations.

The supply chain attacks guide explains what provenance proves and what it does not, so the worksheet only records when it changes. The CI/CD security guide covers hardening the runner that performs the install.

Native modules: compiled code tied to a Node.js version

A native module, or addon, is compiled code that Node.js loads like any other module; the addons documentation calls addons dynamically-linked shared objects that can be loaded through require().

When npm installs one, it uses its own bundled copy of node-gyp to compile it for the user's platform on demand, and node-gyp detects the Node.js release and downloads either the full source tarball or just the headers. npm's documentation adds that a package with a binding.gyp file and no install or preinstall script of its own gets node-gyp rebuild as its install script by default.

This page's reading is that a native module is an install script by another route, with a compiler run and a header download on whatever machine installs it.

Compiled code is tied to the runtime that loads it. The process documentation says process.versions.modules gives the ABI version, which increases whenever a C++ API changes, and that Node.js refuses to load modules compiled against a different module ABI version. Node-API, marked Stable, is meant to remove that tie.

Its documentation says it is ABI stable across Node.js versions, intended to let a module compiled for one major version run on later ones without recompilation, and that an addon stays ABI-compatible across major versions only if it uses Node-API exclusively and checks that its external libraries offer similar ABI stability. npm's rebuild documentation names installing a new version of Node.js, where C++ add-ons need recompiling, as one use of npm rebuild.

So the upgrade that keeps an application on a supported line is also a change that can stop a native module loading. This page's advice is to list native modules before the upgrade: which packages carry compiled code, whether each uses Node-API, and the ABI number on the machine that builds and on the machine that runs.

The lab's install report checks each installed package for a binding.gyp and for .node files.

Under the permission model, native addons are restricted unless --allow-addons is given, and the threat model trusts native code it is asked to run just as it trusts JavaScript.

Node.js security best practices the project itself lists

The Node.js project keeps a security best practices page whose threat list mixes runtime and application concerns.

It says some of those topics are not vulnerabilities in Node.js core under the threat model, but are still application-level threats to account for when building and operating Node.js software. The list includes denial of service against the HTTP server, DNS rebinding through the inspector, timing attacks, malicious third-party modules, monkey patching, prototype pollution and uncontrolled search paths.

Four of its points follow, each with some of the mitigations it lists, and one of this page's own at the end.

  • HTTP server denial of service: put a reverse proxy in front, configure the server timeouts (the page names headersTimeout, requestTimeout, timeout and keepAliveTimeout), and limit the number of open sockets per host and in total.
  • Timing attacks: compare secrets with timingSafeEqual, which the page describes as the crypto API's constant-time comparison for actual and expected sensitive values.
  • Prototype pollution: create objects without a prototype using Object.create(null), check that a property is the object's own with Object.hasOwn(), and consider the --disable-proto flag, which the command-line documentation says removes Object.prototype.__proto__ or makes accessing it throw, depending on the mode given.
  • Uncontrolled search paths: the page says Node.js assumes the directory in which a module is requested is trusted. This page's reading is that write access to an application's folders amounts to write access to its code.
  • Secrets in errors and logs: the proxy-credential fix in the November 2026 post is one example of a secret reaching logs, and the secrets exposure guide covers finding and rotating exposed keys.

How to use the runtime and dependency triage worksheet

The worksheet keeps the six kinds of finding apart because different people fix them.

A Node.js upgrade is a change to a server or container image. A package advisory is a dependency update in the code. An install script or a provenance change is a decision about trust for whoever approves dependencies, and a native module ties the runtime and the packages together.

Every finding goes on one log with an owner, the person who can make the change, so nothing waits on the wrong desk.

  • Fill section 1 for every environment the application runs in: production, each CI or build image, and the images developers use. Read each release status from the Node.js pages on the day you fill it in, and write that date beside it.
  • Fill sections 2 to 6 once for each commit you review, from that commit's lockfile and installed tree.
  • Use the lab's install-report.mjs and lockfile-drift.mjs on your own project if they help. Both read files and change nothing, and they are illustrations rather than maintained tools.
  • Every check reads and records. Where a fix needs a change, such as an upgrade or npm rebuild, log it as a decision and make it as its own planned change.
  • Record secrets by name and location only. A value never goes into the worksheet.
  • Revisit section 1 when the Node.js blog posts a security release, and sections 3 to 6 whenever the lockfile changes.

The offline lab: install scripts, lockfile drift and engines in practice

The asset ends with a lab you can run on your own machine.

It packs four versions of three invented packages into local tarballs and installs them into an invented app, with npm set to offline, empty user and global configuration files and a cache inside the lab, so no step contacts a registry.

It ran on Node.js v26.0.0 and npm 11.12.1 on macOS. Those are the versions on the machine that ran it, not a recommendation, and every result below is an illustration from that run.

  • Moving the app to a new dependency set raised two flags in the drift report: a new version that added a postinstall script, and a new package, standing in for a native module, with an install script, a binding.gyp, an engines range and a cpu restriction.
  • npm ci ran both install scripts, and each could read a variable set on the npm command line. With --ignore-scripts, neither ran.
  • npm warned about a package whose engines range the running Node.js did not meet and installed it anyway. With --engine-strict it refused with EBADENGINE.
  • On Node.js v26.0.0, process.release.lts printed undefined and process.versions.modules printed 147.
  • Left out: npm 12, whose documentation says dependency install scripts are blocked by default; any real compile; and anything that needs registry data, such as npm audit, npm audit signatures and provenance.

What a review of your own setup cannot show

A completed worksheet records versions, settings and decisions on the day it was filled in.

It shows whether you run a release that fixes a runtime flaw, not whether that flaw is reachable through your traffic. It does not show what a package does once your application imports it: skipping install scripts leaves that code in place, and the threat model trusts it. It cannot read compiled code, and it says nothing about security releases published after the date at the top.

Nor can it tell you whether your own routes check who is asking. Authorisation, input handling and the way the application uses Node.js APIs are application-level questions in the threat model's own terms. Answering them takes reading the code and exercising the running application as its users would, which version numbers cannot do.

Where a Clever Ops review fits

This guide is an informational hardening resource, and nothing on it is a test of Node.js or npm themselves.

Clever Ops does not provide round-the-clock monitoring, so the worksheet and the lab are for your own team to keep and rerun.

Active testing of your own Node.js application sits within a scoped web application penetration test, a signed-in test in which the tester uses test accounts for each role the scope names and works through both the application and its API. In a secure code review, the lockfile is read against the package manifest, new packages and versions are checked against published advisories, and package scripts, CI workflow files and anything else that runs on its own at install, build or deploy time are read too. Each report covers the build that was reviewed, on the dates it was reviewed.

Where Clever Ops built or hosts the application, the report calls the work a security review, not an independent penetration test, and states who built and who hosts it.

Frequently asked questions

Read the status on the Node.js Releases page and the release schedule on GitHub on the day you check. On 14 November 2026 the schedule listed 26.x as Active LTS, 24.x and 22.x as Maintenance LTS and 27.x as Alpha, with 20.x and 25.x already end-of-life. The Node.js end-of-life page says an end-of-life version no longer receives updates, including security patches, and the Releases page says production applications should only use Active LTS or Maintenance LTS releases.

No. The Node.js threat model trusts the code it is asked to run, including every dependency installed from the npm registry, and says a scenario that needs a malicious third-party module cannot be a vulnerability in Node.js. The Node.js security reporting page asks for security bugs in third-party modules to be reported to their maintainers. The fix comes from the package, through an update your team makes.

The Node.js security policy names two places: the Vulnerabilities category of the Node.js blog and the nodejs-sec Google Group. The post of 11 November 2026, read on 14 November 2026, lists Node.js v24.22.3 for the 24.x line under its downloads and release details. The policy also notes a built-in delay before a release's CVEs are publicly disclosed, so the CVE record can appear after the post.

npm's documentation says that with ignore-scripts set, npm does not run scripts specified in package.json files, although commands such as npm start, npm test and npm run still run the script they name. In the lab, npm ci with --ignore-scripts ran neither invented install script. This page's reading is that the setting does not stop a package's own code running when your application imports it. npm's rebuild documentation says npm install usually does the rebuild for you unless those steps were suppressed with --ignore-scripts or --no-bin-links, and describes installing with --ignore-scripts and then choosing which packages to build.

No. Its documentation calls it a seat belt that prevents trusted code from unintentionally using resources it was not granted, and says it does not protect against malicious code. The Node.js security policy says it is designed to reduce the blast radius of mistakes in trusted code, not to act as a security boundary against intentional misuse. It is marked Stable from Node.js 23.5.0 and 22.13.0, and the security release of 11 November 2026 included two fixes to it.

It depends on how they were built. The Node.js process documentation says Node.js refuses to load modules compiled against a different module ABI version, which process.versions.modules reports. Node-API is ABI stable across Node.js versions, so a module that uses it exclusively, with external libraries that offer similar ABI stability, is meant to run on later major versions without recompiling. For the rest, npm's rebuild documentation describes recompiling C++ add-ons after installing a new version of Node.js.

Scope the right test for your application

Tell us what you have built, who uses it and when it needs to launch. You will get a plain-English recommendation: a website audit, a web application test or a referral to a specialist.