GHSA-P498-V437-472G

GHSA-P498-V437-472G is a medium-severity path traversal vulnerability in @humanfs/node (npm), affecting versions < 0.16.8. It is fixed in 0.16.8.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

humanfs: Recursive copy follows symlinked files and copies data from outside the source tree

@humanfs/node does not treat symlinks as a separate case during copy operations. A symlink placed inside an attacker-controlled source tree can make copyAll() read and copy the contents of any file readable by the process, even when that file is outside the directory being copied.

Details

The Node implementation exposes symlink state through list(), but copyAll() ignores it. During recursive copies, every non-directory entry is passed to copy(), which delegates to fs.promises.copyFile().

On Node, copyFile() dereferences symlinks. As a result, a symlink inside the copied tree is handled as if it were an ordinary file, and the destination receives the contents of the symlink target rather than a copy of the link itself.

That breaks the expected boundary of a directory copy. A caller can point copyAll() at a seemingly self-contained directory and still end up copying data from elsewhere on the host filesystem if the source tree contains attacker-supplied symlinks.

The same dereference behavior also affects copy() when the source path itself is a symlink.

PoC

import { NodeHfs } from "@humanfs/node";
import fs from "node:fs/promises";
import path from "node:path";
import os from "node:os";

const root = await fs.mkdtemp(path.join(os.tmpdir(), "humanfs-"));
const src = path.join(root, "src");
const dst = path.join(root, "dst");
const secret = path.join(root, "secret.txt");

await fs.mkdir(src);
await fs.writeFile(secret, "TOPSECRET");
await fs.symlink(secret, path.join(src, "link.txt"));

const hfs = new NodeHfs();
await hfs.copyAll(src, dst);

console.log(await fs.readFile(path.join(dst, "link.txt"), "utf8"));
// TOPSECRET

Impact

If an application uses copyAll() or copy() on attacker-controlled paths, a symlink can be used to pull arbitrary readable host files into the copied output. In practice, that can turn a normal workspace copy, export, or packaging step into a file disclosure primitive.

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

Affected versions

@humanfs/node (< 0.16.8)

Security releases

@humanfs/node → 0.16.8 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade @humanfs/node to 0.16.8 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is GHSA-P498-V437-472G? GHSA-P498-V437-472G is a medium-severity path traversal vulnerability in @humanfs/node (npm), affecting versions < 0.16.8. It is fixed in 0.16.8. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
  2. Which versions of @humanfs/node are affected by GHSA-P498-V437-472G? @humanfs/node (npm) versions < 0.16.8 is affected.
  3. Is there a fix for GHSA-P498-V437-472G? Yes. GHSA-P498-V437-472G is fixed in 0.16.8. Upgrade to this version or later.
  4. Is GHSA-P498-V437-472G exploitable, and should I be worried? Whether GHSA-P498-V437-472G is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether GHSA-P498-V437-472G is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix GHSA-P498-V437-472G? Upgrade @humanfs/node to 0.16.8 or later.

Stop the waste.
Protect your environment with Kodem.