GHSA-p498-v437-472g
Fix: humanwhocodes/humanfs@22bbaa4GHSA-p498-v437-472g is a security vulnerability in @humanfs/node. O3 Security confirms whether GHSA-p498-v437-472g is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
humanfs: Recursive copy follows symlinked files and copies data from outside the source tree
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@humanfs/nodenpmDescription
Summary
@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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @humanfs/node | all versions | 0.16.8 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @humanfs/node. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update @humanfs/node to 0.16.8 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-p498-v437-472g is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-p498-v437-472g is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-p498-v437-472g. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-p498-v437-472g in your dependencies?
O3 detects GHSA-p498-v437-472g across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.