Skip to content
Path traversal Disclosed report Intermediate CVE-2025-23084

Path traversal by drive name in Windows environment

Certain Node.js path functions on Windows did not treat drive names as special, so a path that looked relative could actually resolve to the root of a drive. An attacker able to influence a path passed to path.join could therefore reach files outside the intended directory.

taise Follow

Originally disclosed on HackerOne

Medium 5.6 View original
  • Triaged in 53 days
  • Fixed in 12 months
  • Disclosed after 13 months

Summary by the program

A vulnerability has been identified in Node.js, specifically affecting the handling of drive names in the Windows environment. Certain Node.js functions do not treat drive names as special on Windows. As a result, although Node.js assumes a relative path, it actually refers to the root directory.

On Windows, a path that does not start with the file separator is treated as relative to the current directory.

This vulnerability affects Windows users of path.join API.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 3 min read.

What the report shows

The target is the Node.js runtime, specifically the path.join API on Windows. The report is a short summary written by the program, and it describes a path traversal issue that arises from how Node.js handles drive names in the Windows environment.

The core observation is that certain Node.js functions do not treat drive names as special on Windows. On Windows, a path that does not start with the file separator is treated as relative to the current directory. Because drive names are not handled as special, Node.js can assume a path is relative when it actually refers to the root directory.

The report states that the vulnerability affects Windows users of path.join. It does not include a proof-of-concept payload, a reproduction script, affected version numbers, or a description of the fix. The disclosed record lists the severity as medium with a CVSS score of 5.6, the weakness as path traversal, and the researcher as taise. No bounty amount is given.

Root cause

The report says certain Node.js functions do not treat drive names as special on Windows, so a path assumed relative can refer to the root directory. The mismatch between what Node.js assumes and what Windows does is what turns an apparently relative path into a root-relative one.

Impact

On Windows, path.join can produce a path that Node.js assumes is relative but that refers to the root directory. The report does not describe a specific exploitation scenario, so the practical impact depends on how the affected API is used by downstream code.

How this kind of bug works

Path traversal is a class of bug where user-controlled input reaches a filesystem operation without being constrained to an intended base directory. The canonical form uses .. sequences to climb out of a directory, but the same effect can be produced by any input that the path library and the operating system interpret differently.

On Windows there are several such interpretation gaps: drive letters, UNC paths, alternate data streams, trailing dots and spaces, and device names. A library that normalises paths according to POSIX rules, or that only checks for a leading separator, can classify a path as relative when the OS treats it as absolute. The defence is to resolve the final path and then verify that it is still contained within the expected base directory, rather than relying on string inspection of the input.

How to test for it

  1. Identify every place where user input is combined into a filesystem path. Look for upload handlers, template loaders, static file servers, archive extractors, log readers and anything that takes a filename parameter.
  2. Determine the platform the code runs on. Windows-specific handling bugs only manifest when the code executes on Windows, so note whether the target is Windows-hosted.
  3. Send inputs that are relative under one interpretation and absolute under another: a drive-qualified segment, a leading separator, mixed separators, and encoded variants of each. Observe whether the response differs from the baseline.
  4. A positive result is a response that reveals content from outside the intended directory, or an error message that discloses a path rooted at a drive rather than the working directory.
  5. Common false positives: the application may normalise or reject the input before it reaches the filesystem call; the server may not be running on Windows; or the reflected path may appear in an error message without any actual file access occurring. Confirm with a read of a known file outside the base directory before reporting.

How it is fixed

The standard fix is to resolve the candidate path to its canonical absolute form and then check that it is contained within the intended base directory, rejecting anything that escapes. On Windows this means explicitly handling drive names, UNC prefixes and device paths rather than assuming a leading separator is the only marker of an absolute path.

Hunting notes

This class of bug tends to hide in code that was written with POSIX assumptions and later deployed on Windows: cross-platform libraries, CLI tools, build systems and anything that manipulates paths generically. Recon signals include Windows-specific code branches, use of path libraries without containment checks, and features that accept filenames or archive entries.

To get a report accepted, demonstrate a concrete read or write outside the intended directory, state the platform clearly, and show the exact input that triggers it. A theoretical mismatch between library and OS behaviour is much weaker than a demonstrated escape.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What happened, in plain words

Node.js is a program that lets developers run JavaScript outside a browser, for example on a web server. It ships with a set of built-in helpers for working with files, and one of them is called path.join. Its job is to glue pieces of a file path together into one clean path, the way you might stick address lines together to form a full postal address.

The report describes a problem with path.join on Windows. On Windows, a path that does not start with the file separator (the backslash character) is treated as relative to the current directory. Think of a relative path as saying "the folder two doors down from where I am standing": it only makes sense in relation to your current position. An absolute path is more like a full street address: it points to the same place no matter where you are.

The core observation is that certain Node.js functions do not treat drive names as special on Windows. A drive name is the letter plus colon at the start of a Windows path, such as C:. Because drive names are not handled as special, Node.js can assume a path is relative when it actually refers to the root directory. The root directory is the very top of a drive, the equivalent of the ground floor of a building rather than a room inside it.

The report states that the vulnerability affects Windows users of the path.join API. It does not include a proof-of-concept payload, a reproduction script, affected version numbers, or a description of the fix. The disclosed record lists the severity as medium with a CVSS score of 5.6, the weakness as path traversal, and the researcher as taise. No bounty amount is given.

Why this matters

On Windows, path.join can produce a path that Node.js assumes is relative but that refers to the root directory. The report does not describe a specific exploitation scenario, so the practical impact depends on how the affected API is used by downstream code.

Root cause

The report says certain Node.js functions do not treat drive names as special on Windows, so a path assumed relative can refer to the root directory. The mismatch between what Node.js assumes and what Windows does is what turns an apparently relative path into a root-relative one.

In general, how this kind of bug works

Path traversal is a class of bug where user-controlled input reaches a filesystem operation without being constrained to an intended base directory. The classic form uses .. sequences to climb out of a directory, but the same effect can be produced by any input that the path library and the operating system interpret differently.

On Windows there are several such interpretation gaps: drive letters, UNC paths, alternate data streams, trailing dots and spaces, and device names. A library that normalises paths according to POSIX rules, or that only checks for a leading separator, can classify a path as relative when the OS treats it as absolute. The defence is to resolve the final path and then verify that it is still contained within the expected base directory, rather than relying on string inspection of the input.

How to test for it

  1. Identify every place where user input is combined into a filesystem path. Look for upload handlers, template loaders, static file servers, archive extractors, log readers and anything that takes a filename parameter.
  2. Determine the platform the code runs on. Windows-specific handling bugs only manifest when the code executes on Windows, so note whether the target is Windows-hosted.
  3. Send inputs that are relative under one interpretation and absolute under another: a drive-qualified segment, a leading separator, mixed separators, and encoded variants of each. Observe whether the response differs from the baseline.
  4. A positive result is a response that reveals content from outside the intended directory, or an error message that discloses a path rooted at a drive rather than the working directory.
  5. Common false positives: the application may normalise or reject the input before it reaches the filesystem call; the server may not be running on Windows; or the reflected path may appear in an error message without any actual file access occurring. Confirm with a read of a known file outside the base directory before reporting.

How it is fixed

The standard fix is to resolve the candidate path to its canonical absolute form and then check that it is contained within the intended base directory, rejecting anything that escapes. On Windows this means explicitly handling drive names, UNC prefixes and device paths rather than assuming a leading separator is the only marker of an absolute path.

Hunting notes

This class of bug tends to hide in code that was written with POSIX assumptions and later deployed on Windows: cross-platform libraries, CLI tools, build systems and anything that manipulates paths generically. Recon signals include Windows-specific code branches, use of path libraries without containment checks, and features that accept filenames or archive entries.

To get a report accepted, demonstrate a concrete read or write outside the intended directory, state the platform clearly, and show the exact input that triggers it. A theoretical mismatch between library and OS behaviour is much weaker than a demonstrated escape.

Glossary

  • Node.js: a runtime that lets JavaScript run outside a browser, commonly used for web servers and command-line tools.
  • API: a defined set of functions a program offers so other code can use its features.
  • path.join: a Node.js helper that combines path segments into one normalised path.
  • Path: the text that identifies the location of a file or folder on a disk.
  • Relative path: a path interpreted from the current directory, not from the top of the drive.
  • Absolute path: a path that points to the same location regardless of the current directory.
  • Drive name: the letter and colon at the start of a Windows path, such as C:.
  • Root directory: the top-level directory of a drive or filesystem.
  • File separator: the character that divides path segments, a backslash on Windows.
  • Path traversal: a bug where user input escapes an intended directory and reaches files elsewhere.
  • Normalisation: the process of rewriting a path into a standard, cleaned-up form.
  • POSIX: a family of standards for Unix-like systems, whose path rules differ from Windows.
  • UNC path: a Windows path that starts with two backslashes and names a network share.
  • Alternate data stream: an extra data channel attached to a file on some Windows filesystems.
  • Device name: a reserved Windows name such as CON or NUL that refers to a device rather than a file.
  • CVSS: a scoring system that rates the severity of a security vulnerability.
  • Proof of concept: a small demonstration showing that a vulnerability can actually be triggered.

More by taise

View all

3 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.