What Is the Latest Node.js Vulnerability?
A newly disclosed Node.js vulnerability has raised concerns for developers, DevOps engineers, cloud administrators, and organisations running JavaScript applications on their servers.
On October 21, 2026, the Node.js project released security updates addressing ten vulnerabilities across its supported 22.x, 24.x, and 26.x release lines. One of the most serious issues is CVE-2026-111497, a vulnerability in the Brotli decoder bundled with Node.js that can potentially allow remote code execution.
The flaw is sometimes referred to in security discussions as Node2Shell. It involves unsafe handling of malformed Brotli-compressed data, which can cause an out-of-bounds memory write. Depending on how an application processes attacker-controlled compressed data, exploitation could lead to a crash, memory disclosure, or execution of malicious code.
The security update is particularly important for Node.js applications that process compressed HTTP responses, accept Brotli-compressed request bodies, or decompress untrusted data through the built-in node:zlib module.
The good news is that fixed Node.js releases are available. Developers should check their runtime versions, update affected systems, rebuild container images, and audit their application dependencies.
In this guide, we explain the latest Node.js vulnerability, its root cause, affected versions, the official fix, npm security scanning, and practical steps to protect production applications.
Node.js Vulnerability 2026: Quick Summary
| Detail | Information |
| Node.js Vulnerability | CVE-2026-111497 |
| Commonly used name | Node2Shell |
| Disclosure and patch date | October 21, 2026 |
| Affected component | Bundled Brotli decoder |
| Vulnerability type | Out-of-bounds write |
| Potential impact | Remote code execution, memory disclosure, denial of service |
| Node.js severity | High |
| CVSS v4.0 score | 9.2 |
| Fixed Node.js versions | 22.23.4, 24.22.1, 26.12.1 |
| Recommended action | Upgrade to a fixed release or a later security release |
The Node.js project’s official advisory identifies the flaw as high severity. Singapore’s Cyber Security Agency separately assigned a CVSS v3.1 score of 9.8, so severity scores should always be reported with their scoring system. Official Node.js security advisory.
1. What Is CVE-2026-111497 (Node2Shell)?
CVE-2026-111497 is a security vulnerability in the Brotli decoder bundled with Node.js.
Brotli is a data compression format that reduces the size of web traffic. It is commonly used to compress HTTP responses and, in some applications, HTTP request bodies.
Node.js includes Brotli functionality through its built-in node:zlib module. Applications can also encounter Brotli data indirectly through HTTP clients, frameworks, and other dependencies.
The Node.js vulnerability occurs when the decoder processes certain malformed compressed input. Under specific conditions, the decoder incorrectly treats an invalid block-switch operation as a temporary request for more input instead of a permanent format error.
This causes the streaming decoder to append data to an internal buffer beyond its intended boundary.
The result is an out-of-bounds write, a type of memory-safety error that can corrupt adjacent memory.
Depending on the execution environment and the application’s exposure, the consequences can include:
- Application crashes or denial of service.
- Disclosure of sensitive process memory.
- Potential remote code execution.
Not every Node.js application is equally exposed. Exploitation requires an application to decompress attacker-controlled Brotli data through an affected runtime.
Nevertheless, because the impact can be serious and the fix is available, affected systems should be updated urgently.
2. What Caused the Node.js Vulnerability?
The underlying cause is an error in the Brotli decoder’s handling of malformed compressed input.
Incorrect error handling
When the decoder encounters an invalid block switch, it should reject the stream as malformed. In the vulnerable implementation, the condition was instead treated as though the decoder needed additional input.
Unsafe buffer handling
Because the decoder continued processing the stream, it could append bytes beyond the intended size of an internal buffer. This resulted in an out-of-bounds write.
Why this becomes a security problem
Memory corruption can affect data or structures used by the running process. In certain circumstances, this can allow an attacker to crash the application, expose memory contents, or potentially influence program execution.
The node.js vulnerability is not necessarily caused by a mistake in an application’s own JavaScript code. It originates in the bundled native compression component.
That distinction matters: updating an application’s business logic or installing a newer Express package does not automatically fix a vulnerable Node.js runtime.
The Node.js project incorporated an upstream Brotli fix into its security releases. The patched decoder correctly rejects the invalid stream instead of continuing with unsafe buffer handling.
3. Which Node.js Versions Are Vulnerable?
The October 21, 2026, security release identifies the following affected release lines and fixed versions.
| Node.js version | Status | Required action |
| 22.x before 22.23.4 | Vulnerable | Upgrade to 22.23.4 or later |
| 24.x before 24.22.1 | Vulnerable | Upgrade to 24.22.1 or later |
| 26.x before 26.12.1 | Vulnerable | Upgrade to 26.12.1 or later |
| 25.x, 23.x, 20.x and older end-of-life lines | Treat as affected | Migrate to a supported release with the fix |
The fixed versions listed above are the minimum patched releases for their respective supported branches at the time of the advisory. Prefer the latest appropriate security release available for your branch.
Important: End-of-life Node.js versions do not automatically receive the new security patch. Moving to a supported release is the recommended long-term solution.
Official reference: Node.js October 2026 security releases.
4. How Can an Application Be Exposed to Node2Shell?
A Node.js application may be exposed when it decompresses Brotli data controlled by an untrusted party.
Three common scenarios deserve attention.
Scenario 1: An application accepts Brotli-compressed requests
Some request parsers support Brotli decompression for incoming HTTP request bodies.
For example, applications using Express 5 and body-parser 2.x may process Brotli-encoded request bodies, depending on their parser configuration and middleware.
An attacker may be able to send a crafted request containing malicious compressed data to an exposed endpoint.
Scenario 2: An application fetches external URLs
Node.js’s built-in fetch() can automatically decompress Brotli-compressed HTTP responses.
If an application fetches data from an attacker-controlled or compromised server, that response may introduce untrusted compressed input into the vulnerable decoder.
This is particularly relevant to applications that retrieve remote documents, accept user-supplied URLs, or process third-party webhooks and integrations.
Scenario 3: An application decompresses data directly
Developers may use the built-in node:zlib module to decompress data from files, APIs, uploads, or external systems.
Any code path that sends untrusted data to the affected Brotli decoding functionality should be reviewed.
A simple Node.js HTTP server does not automatically decompress every incoming request body. Exposure depends on the application’s actual request processing and dependencies.
The safest approach is to patch the runtime and then review these data flows to understand the application’s exposure.
5. How to Fix the Node.js Vulnerability
The primary remediation is to upgrade Node.js to a patched release.
Step 1: Check your current Node.js version
Run this command in your terminal:
node –version
Example output:
v24.22.0
In this example, the runtime is older than the fixed 24.22.1 release.
Also check npm:
npm –version
Remember that the npm version and Node.js version are different. Updating npm alone does not patch the Node.js runtime.
Step 2: Upgrade to a fixed Node.js release
Use the installation method appropriate for your environment.
For example, developers using a Node Version Manager (nvm) can install a fixed release with:
nvm install 24.22.1
nvm use 24.22.1
node –version
This is an example for environments where nvm is installed and the specified release is available. For production, select the latest appropriate patched release rather than pinning an old patch indefinitely.
Other environments may require:
- Updating Node.js through the official installer.
- Upgrading operating-system packages.
- Updating the Node.js version configured by a hosting provider.
- Changing the runtime used by a serverless deployment.
- Updating a Docker base image.
Step 3: Rebuild and redeploy containers
If your application uses Docker, updating Node.js on your development computer does not automatically update the runtime inside an existing container.
Check the version inside a running or newly built container:
docker run –rm your-image-name node –version
Replace your-image-name with the actual image name.
Update the Dockerfile or base image reference, rebuild the image, and redeploy it. Verify the runtime version inside the deployed environment.
Avoid assuming that a mutable image tag or an updated local image has automatically updated every production deployment.
Step 4: Restart application processes
After upgrading Node.js, restart or redeploy the affected application processes. Confirm that old processes are no longer running the vulnerable runtime.
For managed platforms, check the runtime version actually used by the deployed service rather than relying solely on your local terminal.
Step 5: Test and verify
After deployment:
- Confirm the active Node.js version.
- Test critical API endpoints.
- Test file uploads, HTTP clients, and integrations.
- Review application logs for errors.
- Run dependency security audits.
- Verify all production servers, containers, CI runners, and development environments have been addressed.
The fix should be considered complete only after the patched runtime is active in every relevant environment.
6. Is There a Workaround for CVE-2026-111497?
The official Node.js advisory does not provide a complete workaround for this vulnerability.
If an immediate upgrade is impossible, temporary exposure-reduction measures may include:
- Rejecting Brotli-encoded incoming request bodies at a reverse proxy or API gateway.
- Restricting applications from fetching arbitrary external URLs.
- Limiting access to endpoints that process untrusted compressed data.
- Applying request-size limits and suitable resource controls.
- Isolating affected services from public access where feasible.
These measures reduce some attack paths, but they do not repair the underlying decoder.
For example, blocking incoming Brotli requests will not necessarily protect an application that receives Brotli-compressed responses from an external service through fetch().
Treat workarounds as temporary risk-reduction measures and prioritise the official runtime update.
7. What Are the Other Node.js Vulnerabilities in October 2026?
The October 21 security release addressed ten vulnerabilities. CVE-2026-111497 is the most prominent issue, but the other fixes also matter.
The following table highlights five significant issues from that release. It is not a ranking of the five most dangerous vulnerabilities in all software.
| CVE | Severity in Node.js advisory | Issue |
| CVE-2026-111497 | High | Brotli decoder out-of-bounds write; potential remote code execution |
| CVE-2026-105482 | High | DNS resolution can truncate hostnames containing NUL bytes |
| CVE-2026-105483 | High | TLS certificate hostname verification issue involving fullwidth digits in IP addresses |
| CVE-2026-106069 | High | TLS hostname verification can validate a certificate against a different IP address |
| CVE-2026-105481 | Medium | HTTP Agent may process a response written before the request was sent |
These vulnerabilities have different prerequisites and impacts. For example, the TLS issues are relevant to applications that make secure outbound connections and rely on hostname verification. The DNS issue matters when an application validates hostnames before resolving them.
The same October release also addressed issues involving TLS certificate validation, cryptographic random-value caches, ZIP file processing, and the Node.js Permission Model.
The practical recommendation is to install the appropriate security release instead of trying to patch only CVE-2026-111497 manually.
Source: Official Node.js security release notes.
8. What Are npm Vulnerabilities?
npm vulnerabilities are security weaknesses associated with packages in the npm ecosystem.
npm is the package manager commonly used with Node.js. Applications often depend on third-party libraries for routing, authentication, database access, HTTP requests, file processing, and other functionality.
A vulnerability in one of those packages may affect an application that uses it, even when the application’s own code does not contain the original defect.
Common types of npm package vulnerabilities include:
- Prototype pollution: An attacker may manipulate object properties in ways that affect application behaviour.
- Cross-site scripting (XSS): Unsafe handling of untrusted content may allow malicious scripts to execute in a user’s browser.
- Path traversal: Incorrect path validation may permit access to files outside an intended directory.
- Denial of service: Crafted input may cause excessive resource consumption or application failure.
- Authentication or authorisation flaws: Incorrect security checks may allow access to protected functionality.
- Remote code execution: Certain vulnerabilities may allow an attacker to execute code in the context of an affected process.
Not every package vulnerability is exploitable in every application. Exposure depends on the affected version, how the dependency is used, the application’s configuration, and the attacker’s access.
Node.js runtime vulnerabilities and npm package vulnerabilities are also different. CVE-2026-111497 affects the Node.js runtime’s bundled Brotli decoder. An npm dependency audit alone is not sufficient to establish that the runtime has been patched.
9. How to Check npm Vulnerabilities
npm provides a built-in security auditing command that checks project dependencies against known vulnerability information.
Step 1: Open your project directory
Open a terminal in the directory containing your package.json file.
Step 2: Run npm audit
npm audit
This command requests a security audit of the dependency tree and reports known vulnerabilities, affected packages, severity, and possible remediation.
Step 3: Review the results
Look for:
- The affected package.
- The installed version.
- The reported severity.
- The dependency path.
- The vulnerable version range.
- The recommended fixed version.
- Whether the issue can be resolved without a breaking change.
A vulnerable transitive dependency may be introduced by another package rather than directly listed in your package.json.
Step 4: Generate a detailed report
npm audit –json
The JSON output is useful for security automation, CI pipelines, and detailed investigation.
Step 5: Check outdated packages
npm outdated
This command identifies packages with newer versions, but an outdated package is not necessarily vulnerable, and a current package is not necessarily free of vulnerabilities.
Use it alongside npm audit, not as a replacement.
For more information, see the official npm audit documentation.
10. How to Fix npm Vulnerabilities Safely
After identifying vulnerable packages, choose a remediation strategy based on the affected dependency and available fix.
Option 1: Apply compatible fixes
Run:
npm audit fix
npm attempts to apply available fixes that fit the project’s existing dependency requirements.
Review the changes, run the test suite, and inspect the updated lockfile before deploying.
Option 2: Update a specific package
If the audit identifies a directly installed package, update it to a version that contains the relevant security fix.
For example:
npm install package-name@latest
Replace package-name with the actual package. In production applications, verify compatibility and select a secure version appropriate to the project rather than automatically upgrading every dependency to the latest major release.
Option 3: Review issues that require manual changes
Some vulnerabilities cannot be fixed automatically because the current dependency requirements prevent npm from selecting a secure version.
You may need to update the parent dependency, adjust version ranges, replace a package, or apply a compatible upstream fix.
Avoid using npm audit fix –force without reviewing its impact. It can introduce major-version updates and breaking changes.
Option 4: Test and audit again
After applying fixes:
npm audit
npm test
Run the project’s actual build and integration tests as well. Not every project uses npm test, so substitute the appropriate test command where necessary.
Finally, review the changes to package.json and package-lock.json, and redeploy the tested build.
Important: npm audit fix does not fix CVE-2026-111497 in an unpatched Node.js runtime. Update the runtime separately.
11. Can You Provide a List of npm Vulnerabilities?
There is no single permanent list of every npm vulnerability that applies to every application.
The results depend on the project’s dependencies, installed versions, transitive packages, and the advisories available to the registry.
For an accurate list of vulnerabilities in your own project, use:
npm audit
For a machine-readable report:
npm audit –json
For information about a specific CVE or package advisory, consult the NVD vulnerability database, the GitHub Advisory Database, and the package’s official security notices.
When publishing a list of vulnerabilities, include the advisory identifier, affected package and version range, severity, potential impact, and fixed version where known.
Avoid copying an old list of npm vulnerabilities and presenting it as current. New advisories are published regularly, and fixes may change the affected version ranges.
12. How Can Developers Prevent Future Node.js and npm Vulnerabilities?
A sustainable security strategy should combine runtime patching, dependency management, testing, and deployment controls.
Keep Node.js on a supported release
Monitor the official Node.js security announcements and apply security releases promptly. Avoid leaving production services on end-of-life branches.
Audit dependencies regularly
Run npm audit during development and incorporate security checks into continuous integration.
Commit the lockfile
Use a reviewed package-lock.json to improve reproducibility between development, testing, and production environments.
For automated builds, consider:
npm ci
npm audit
These commands install the locked dependency tree and check for known vulnerabilities. A successful audit is not a guarantee that an application has no security weaknesses.
Scan container images
Check the actual runtime inside containers. Ensure that updated images are rebuilt, tested, and redeployed instead of continuing to run vulnerable images.
Restrict untrusted data
Review the handling of user uploads, compressed payloads, external HTTP responses, webhooks, and user-supplied URLs.
Validate inputs, apply appropriate request limits, and avoid granting unnecessary network or filesystem permissions.
Monitor security advisories
Subscribe to official Node.js security announcements and monitor advisories for your direct and transitive dependencies.
Test before deploying
Use automated tests and staging environments to validate security updates. This helps reduce the risk of introducing compatibility problems during urgent patching.
13. Does Cloud Migration Help Improve Node.js Security?
Cloud migration can help organisations modernise legacy applications, standardise runtimes, and improve deployment and monitoring practices.
However, moving an application to a cloud provider does not automatically remove Node.js vulnerabilities. The application must still use a patched runtime and secure dependencies.
A well-planned migration can support:
- Consistent Node.js versions across environments.
- Automated build and deployment pipelines.
- Centralised logging and monitoring.
- Improved network segmentation.
- Better backup and recovery practices.
- More reliable security patching.
- Container image management and runtime verification.
Organisations should review the security responsibilities of their chosen cloud platform. Managed services may handle some infrastructure updates, while application teams remain responsible for other runtimes and dependencies.
If your organisation is modernising legacy infrastructure, explore our cloud migration solutions.
14. Why Is Custom Software Development Important for Application Security?
Custom software development can help organisations address security weaknesses in existing applications and build more maintainable systems.
A secure development process should consider the complete application stack, including the Node.js runtime, npm dependencies, APIs, authentication, data processing, and deployment environment.
Security-focused development may involve:
- Reviewing outdated packages and unsupported runtimes.
- Auditing application dependencies.
- Improving request validation and error handling.
- Testing authentication and authorisation controls.
- Introducing automated security checks.
- Updating container images and deployment pipelines.
- Establishing a regular maintenance and patching schedule.
For businesses operating older Node.js applications, a phased modernisation plan may be more practical than replacing the entire application at once.
Learn more about our custom software development services.
Conclusion: Update Node.js and Strengthen Your Application Security
The October 2026 Node.js security release highlights the importance of maintaining both application dependencies and the underlying runtime.
CVE-2026-111497, commonly referred to as Node2Shell, demonstrates how a memory-safety flaw in a bundled compression component can create serious risks when an application processes untrusted data.
The immediate priorities are to identify vulnerable Node.js installations, upgrade to a fixed release, rebuild affected containers, and verify that the updated runtime is active in production.
Developers should also run npm audit, resolve vulnerable dependencies, and establish a repeatable security-update process.
Do not rely on npm package updates alone to fix a runtime vulnerability. Node.js patching and npm dependency management are separate but complementary parts of application security.
If your organisation needs help modernising legacy applications, improving deployment practices, or building more maintainable software, explore our cloud migration solutions and custom software development services.
