Skip to content
Path traversal Disclosed report Intermediate

Windows Device Names Still Allow Path Traversal in UNC Paths After CVE-2025-27210 Fix

The CVE-2025-27210 fix for Windows device names in Node.js path handling does not cover UNC network paths when using path.join(), so a crafted device name with traversal sequences can escape the intended directory. An attacker could read files outside the intended directory on Windows network shares.

oblivionsage Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Disclosed after 12 days

Summary:

I found that Windows device names (CON, PRN, AUX, etc.) can still be used for path traversal attacks when working with UNC network paths, even after the CVE-2025-27210 patch. So basically, the fix only covered regular paths but missed the UNC path scenario when using path.join()

Description:

I was testing the recent CVE-2025-27210 fix and noticed something . The patch works fine for regular paths - if I try path.normalize('CON:../../secret.txt'), it correctly returns .\CON:..\..\secret.txt. Great that's fixed

But then I started testing UNC paths (you know, network paths like \\server\share) and found the vulnerability still exists there. The issue is that when you use path.join() with a UNC path and a device name, the device name gets stripped and the traversal happens

Here's what I mean:

JavaScript
const path = require('path');

// This is fixed (regular path)
console.log(path.normalize('CON:../../secret.txt'));
// Output: .\CON:..\..\secret.txt ✓

// But this is still vulnerable (UNC path)
console.log(path.join('\\\\server\\share\\uploads', 'CON:../../secret.txt'));
// Output: \\server\share\secret.txt ✗
// Should be: \\server\share\uploads\.\CON:..\..\secret.txt
image.png
image.png From the original on HackerOne

This happens because the normalize function inside path.join() handles UNC paths differently than regular paths

Steps to Reproduce:

  1. Use any Node.js version including the latest v24.4.1 (with CVE-2025-27210 fix)

  2. Create a simple test file:

JavaScript
const path = require('path');

function getNetworkFile(userInput) {
  const basePath = '\\\\\\\\fileserver\\\\public\\\\uploads';
  return path.join(basePath, userInput);
}

console.log(getNetworkFile('CON:../../../private/passwords.txt'));
"
  1. Run the code

  2. Expected result: \\fileserver\public\uploads\.\CON:..\..\..\private\passwords.txt

  3. Actual result: \\fileserver\public\private\passwords.txt (escaped the uploads directory!)

image.png
image.png From the original on HackerOne

Why This is Different from CVE-2025-27210:

So I know what you're thinking - "didn't we just fix this?" Well, kinda. CVE-2025-27210 fixed the issue for regular paths by adding the .\ prefix when it detects device names. But that fix only applies to direct normalize() calls or regular local paths

The difference:

  • CVE-2025-27210: Fixed path.normalize('CON:../') for local paths
  • This bug: UNC paths like \\server\share + device names still vulnerable when using path.join()

It's essentially a bypass of the CVE-2025-27210 fix for network scenarios

Mitigation:

To fix this, you should apply the same device name validation logic to UNC paths in the path.join() function. Specifically, when joining paths that start with \\, the code needs to check for device names and add the .\ prefix just like it does for regular paths

The fix probably needs to go in the normalize function's UNC path handling section, around where it processes paths starting with \\.

Impact

An attacker could read files outside the intended directory on Windows network shares :

  • File sharing applications (escape to other users' folders)
  • Cloud storage systems using UNC paths
  • Corporate network shares (access sensitive documents)
  • Any Node.js app that serves files from network locations

Also, this could lead to lateral movement in corporate networks - imagine escaping from \\webapp\public to \\webapp\C$\Windows\System32\config or even to other servers like \\adminserver\C$.

The original report as published on HackerOne, by oblivionsage. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the device-name validation added for CVE-2025-27210 is not applied in the UNC path handling branch of path.join()'s internal normalisation, so device names are stripped and traversal sequences are resolved.

Impact

An attacker could read files outside the intended directory on Windows network shares; lateral movement is a possible scenario.

What the attacker needed

Node.js on Windows; App uses path.join() with UNC base path; Attacker controls part of the path

The fix

The device name validation logic should be applied to UNC paths in path.join() so that a .\ prefix is added when a device name is detected.

How it was found

  1. Use a Node.js version that includes the CVE-2025-27210 fix.
  2. Create a test script that calls path.join() with a UNC base path and a device-name input containing traversal sequences.
  3. Run the script.
  4. Observe that the resulting path escapes the intended uploads directory.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Windows has special reserved names like CON and PRN that can behave oddly in file paths. Node.js tried to fix a bug where these names could be used to climb out of a folder, but the fix missed network paths (UNC paths like \\server\share). This means an attacker can still use a device name to reach files outside the folder the app meant to serve.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by oblivionsage

View all

6 more disclosed reports, best first.

More from Node.js

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.