{"answers":{"affected":"2 open source packages ship an affected version, including @humanfs/node.","exploited":"There is no known exploitation of GHSA-p498-v437-472g in the wild and no public exploit code.","fix":"Upgrade @humanfs/node to 0.16.8 or later.","what":"GHSA-p498-v437-472g is a path traversal vulnerability in @humanfs/node, published on 2 Sep 2026."},"fix_prompt":"Check this codebase for GHSA-p498-v437-472g and fix it if it is affected.\n\nWhat it is: GHSA-p498-v437-472g is a path traversal vulnerability in @humanfs/node, published on 2 Sep 2026. \nExploitation: There is no known exploitation of GHSA-p498-v437-472g in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @humanfs/node (npm): affected all versions; fixed in 0.16.8\n- @humanfs/node (npm): affected all versions; fixed in 0.16.8\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-p498-v437-472g/ (Markdown: https://insights.sbomify.com/GHSA-p498-v437-472g/index.md)","id":"GHSA-p498-v437-472g","markdown":"https://insights.sbomify.com/GHSA-p498-v437-472g/index.md","name":"GHSA-p498-v437-472g","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"unknown","non_default_config":false,"product_category":"Node.js filesystem library","requires_auth":"none","summary":"Attackers can use symlinks in source directories to copy arbitrary host files into destinations via the humanfs library, leading to information disclosure.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\n\n`@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.\n\n### Details\n\nThe 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()`.\n\nOn 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.\n\nThat 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.\n\nThe same dereference behavior also affects `copy()` when the source path itself is a symlink.\n\n### PoC\n\n```js\nimport { NodeHfs } from \"@humanfs/node\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport os from \"node:os\";\n\nconst root = await fs.mkdtemp(path.join(os.tmpdir(), \"humanfs-\"));\nconst src = path.join(root, \"src\");\nconst dst = path.join(root, \"dst\");\nconst secret = path.join(root, \"secret.txt\");\n\nawait fs.mkdir(src);\nawait fs.writeFile(secret, \"TOPSECRET\");\nawait fs.symlink(secret, path.join(src, \"link.txt\"));\n\nconst hfs = new NodeHfs();\nawait hfs.copyAll(src, dst);\n\nconsole.log(await fs.readFile(path.join(dst, \"link.txt\"), \"utf8\"));\n// TOPSECRET\n```\n\n### Impact\n\nIf 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.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"humanfs: Recursive copy follows symlinked files and copies data from outside the source tree","id":"GHSA-p498-v437-472g","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"path_traversal","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["0.16.8"],"introduced":["0"],"last_affected":[],"package":"@humanfs/node","purl":null,"source":"GHSA-p498-v437-472g"},{"ecosystem":"npm","fixed":["0.16.8"],"introduced":["0"],"last_affected":[],"package":"@humanfs/node","purl":"pkg:npm/%40humanfs/node","source":"GHSA-p498-v437-472g"}],"products":null,"published":"2026-09-02","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can use symlinks in source directories to copy arbitrary host files into destinations via the humanfs library, leading to information disclosure.","url":"https://insights.sbomify.com/GHSA-p498-v437-472g/"}