Node.js CVE-2025-27210 and CVE-2025-27209: Risks and Fixes

On 15 July 2025 Node.js released fixes for two high-severity flaws. CVE-2025-27210 lets attackers bypass path traversal protections on Windows by using reserved device names such as CON, PRN or AUX, which path.normalize() and path.join() did not handle safely; it affects Node.js 20.x, 22.x and 24.x on Windows.

Jul 16, 2025 - 14:23
Updated: 
108.6k

Cyber Threats, Scams & Online Safety in Cybersecurity & Ethical Hacking · News & analysis

Node.js CVE-2025-27210 and CVE-2025-27209: Risks and Fixes

Quick answer: On 15 July 2025 Node.js released fixes for two high-severity flaws. CVE-2025-27210 lets attackers bypass path traversal protections on Windows by using reserved device names such as CON, PRN or AUX, which path.normalize() and path.join() did not handle safely; it affects Node.js 20.x, 22.x and 24.x on Windows. CVE-2025-27209 is a hash collision denial of service (HashDoS) caused by a change to string hashing in the V8 engine used by Node.js 24.x. Upgrade to 20.19.4, 22.17.1 or 24.4.1 or later, and validate file paths against an allowed base directory.

Key takeaways

  • Fixed versions: 20.19.4, 22.17.1 and 24.4.1.
  • CVE-2025-27210 affects Windows only and completes an earlier fix for CVE-2025-23084.
  • CVE-2025-27209 is a denial of service issue in the 24.x line.
  • Normalising a path is not the same as validating it.
  • Run supported Node.js versions so security releases reach you.

Table of Contents

What Are the Two Vulnerabilities?

CVETypeAffectedFixed in
CVE-2025-27210Path traversal on Windows (device names)20.x, 22.x, 24.x on Windows20.19.4, 22.17.1, 24.4.1
CVE-2025-27209HashDoS in V8 string hashing24.x24.4.1

Both are listed in the Node.js July 2025 security release.

How Does CVE-2025-27210 Work?

Windows treats certain names as devices rather than files, including CON, PRN, AUX, NUL, COM1 and LPT1, as listed in Microsoft's file naming rules. Earlier in 2025, Node.js fixed CVE-2025-23084, a Windows path traversal issue in path functions. That fix was incomplete: paths built with device names could still be normalised into locations outside the intended directory. An application that joins user input to a base folder and trusts the result could then read or write files it should not (CWE-22).

How Does CVE-2025-27209 Work?

The V8 version in Node.js 24.0.0 changed how string hashes are computed (to rapidhash). That reintroduced the possibility of hash collision attacks: an attacker who sends many keys that collide, for example in a JSON body or query string, can make hash table operations very slow and tie up the server. The fix in 24.4.1 restores protection.

How Do You Check if You Are Affected?

# Installed version
node -v

# Running on Windows?
node -p "process.platform"

# Find Node.js versions pinned in Docker images or CI
grep -R "node:" Dockerfile* .github/workflows 2>/dev/null

You are affected by CVE-2025-27210 if the output is win32 and the version is below the fixed release for your line. Everyone on 24.x below 24.4.1 is affected by CVE-2025-27209.

How Do You Fix It?

  1. Upgrade to 20.19.4, 22.17.1 or 24.4.1, or any later release in your line.
  2. Rebuild container images and redeploy; base images do not update themselves.
  3. Move off end-of-life lines (check the release schedule); they do not get security fixes.
  4. Limit request body sizes and parameter counts as general HashDoS mitigation.

How Should Code Handle File Paths Safely?

Resolve the path, then confirm it is still inside the allowed folder, and reject device names explicitly on Windows:

const path = require('path');
const BASE = path.resolve('C:/app/uploads');
const RESERVED = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;

function safePath(userInput) {
  const full = path.resolve(BASE, userInput);
  if (!full.startsWith(BASE + path.sep)) throw new Error('outside base');
  if (full.split(path.sep).some(p => RESERVED.test(p))) throw new Error('reserved name');
  return full;
}

Better still, avoid using user input as a file name at all: store files under generated IDs and keep the original name in a database.

What Are the Wider Lessons?

  • Patch runtimes as well as application dependencies; include Node.js in vulnerability scanning.
  • Test path handling on every platform you deploy to.
  • Incomplete fixes happen; subscribe to the Node.js security announcements.

Related: API security tips and common security misconfigurations. WebAsha offers secure coding training.

References

Frequently Asked Questions

It is a Windows path traversal flaw in Node.js where reserved device names bypass protections in path.normalize and path.join.

It is a hash collision denial of service issue caused by a V8 string hashing change in Node.js 24.x.

Node.js 20.19.4, 22.17.1 and 24.4.1, released on 15 July 2025, and any later release in each line.

No. The path traversal issue depends on Windows reserved device names, so it affects Node.js running on Windows only.

Names such as CON, PRN, AUX, NUL, COM1 to COM9 and LPT1 to LPT9, which Windows treats as devices.

An attack that sends many keys with colliding hashes so hash table operations slow down and the server stops responding.

No. Resolve the path and confirm it stays inside an allowed base directory, and preferably avoid user-supplied file names.

Run node -v on the server, and also check versions pinned in Dockerfiles and CI workflows, then upgrade where needed.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.