Exploits

Critical Node.js Flaw Enables DoS in Nearly All Production Apps

Eng. Donya Bino Published  ·  4 min read

ode.js has created urgent security updates that will help to rectify a high level of security vulnerabilities. One vulnerability allows an attacker to create a Denial of Service (DoS) situation, which the Node.js Project considers to exist within almost every production Node.js Application. 

The problem is due to the way async_hooks is implemented and how stack space exhaustion is handled - a situation that exists within many modern frameworks built using Node.js, as well as within APM Solutions.

Why this issue occurs: async_hooks and stack overflow.
Node.js maintainers Matteo Collina and Joyee Cheung state that the default behavior of both Node.js and the V8 engine is to throw a catchable exception in order to recover from a stack overflow. This lets applications continue to run normally.

However, because of an old bug within Node.js, when an application runs into a stack overflow under the async_hooks, the application will stop running immediately and return an exit code of 7 (Runtime Error Internal Exception Handler Failure), and not a recoverable exception has been thrown by the execution of the application. This creates an opening for attackers to create a Denial of Service (DoS) by controlling the recursion depth and sending in maliciously crafted user input that has not yet been effectively validated by the application.

Why the Impact Is So Widespread
The reason this issue is so widespread is that a lot of different frameworks, including React Server Components and Next, are created on top of and thus depend upon AsyncLocalStorage, which is based on async_hooks.

The following technologies are affected:
1. React Server Components
2. Next
3. Datadog
4. New Relic
5. Dynatrace
6. Elastic APM
7. OpenTelemetry

Any application that uses one of these tools could potentially crash due to deep recursion.

How to Patch the Issue
Every version of Node.js from 8.x to 18.x has this vulnerability, but any prior versions will not be patched because they will be unsupported or at an end-of-life status.

The following Node.js releases provide the fix:
1. Node.js 20.20.0 (LTS)
2. Node.js 22.22.0 (LTS)
3. Node.js 24.13.0 (LTS)
4. Node.js 25.3.0 (Current)

The fix works by recognizing stack overflow exceptions and re-throwing them back to the application code instead of marking them as runtime fatal errors.

Classification of Security Issues
CVE-2025-59466, was classified as a severe vulnerability with a CVSS score of 7.5. Even though it has been classified as being very serious, Node.js has called it a mitigation due to the following three reasons:
1. To date, the ECMAScript specification does not include any reference to stack exhaustion;
2. V8 does not consider stack exhaustion to be a security issue; and
3. The limitations of the uncaughtException handler. 

However, Node.js does recognize that this issue can have a real-world effect on developers. “React Server Components, Next.js and virtually all the APM tools will suffer from this problem. Fixing this will create a better developer experience, improve error handling and make it more predictable.” 

Further Node.js Security Fixes
In addition to addressing the above issue, Node.js also fixed three additional security vulnerabilities which were classified as high severity:
1. CVE-2025-55131 - Data leak or corruption
2. CVE-2025-55130 - Arbitrary file read using crafted symlink paths
3. CVE-2025-59465 - Remote denial-of-service

Suggestions for Mitigation Measures
1. Node.js is patching this vulnerability with an urgent release, and developers should upgrade to an updated version of node now;
2. Developers should perform an audit of their current applications to determine if they have any unbounded recursion in the code;
3. Developers should validate all user-supplied input and impose limits on the allowed depth of recursion in the application code;
4. Any library or framework maintainer should be implementing measures to defend against stack exhaustion attacks.

Source: The Hacker News

Professional Services

Explore Our Cybersecurity Services

Our insights are backed by hands-on service delivery. If your business needs professional cybersecurity support, our UK-based specialists are ready to help.

© 2016 – 2026 Red Secure Tech Ltd. Registered in England and Wales — Company No: 15581067