CVE-2026-86775: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in knowns-dev knowns
Affects knowns-dev knownsSource CVE Database V5
Not known to be exploited · CVSS 8.8 High · fixed in 0.30.0 : patch knowns-dev knowns soon.
Data as of 10/24/2026, 22:16:05 UTC
- Exploitation
Not in CISA KEV, no exploitation reported
- EPSS
- 0.7% chance of exploitation in 30 days – higher than 54% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 0.30.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:NWhat to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| knowns-devknowns | Affected
| Fixed in
|
npmknowns-dev/knownspkg:npm/knowns-dev/knownsOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
Upgrade knowns to version 0.30.0 or later, where this path traversal vulnerability is fixed. Until then, restrict access to the Management API to trusted users and networks to prevent exploitation. Patch status is confirmed fixed in version 0.30.0.
Description
knowns (npm package) versions <= 0.29.1 contain a path traversal vulnerability in the Document API. The HTTP handler in internal/server/routes/docs.go normalizes the user-supplied document path with cleanDocPath(), which strips leading/trailing slashes and the .md suffix but does not neutralize ../ traversal sequences, and internal/storage/doc_store.go then builds the target path with filepath.Join(ds.docsDir(), filepath.FromSlash(doc.Path)+".md") without verifying that the resolved path remains inside the documents directory. In the default deployment, where the Management API is unauthenticated and bound to all interfaces, a remote unauthenticated attacker can supply a traversal payload (for example {"path": "../../../../tmp/knowns_pwn_marker"} to POST /api/docs, or an encoded path to GET /api/docs/...) to read, create, overwrite, or delete arbitrary files with a .md extension anywhere on the host filesystem and to create arbitrary directories via os.MkdirAll. This can expose sensitive data stored in other projects' documentation, corrupt or destroy files, and provide an arbitrary-write primitive that may be chained toward code execution. The issue is fixed in version 0.30.0.
Impact
Remote unauthenticated attackers can exploit this vulnerability to perform arbitrary file read, write, create, and delete operations on files with a .md extension anywhere on the host filesystem. This can lead to exposure of sensitive data, corruption or destruction of files, and an arbitrary-write primitive that may be leveraged for code execution. The vulnerability affects deployments where the Management API is unauthenticated and accessible.
Summary
The knowns package versions <= 0.29.1 have a path traversal vulnerability in the Document API's HTTP handler. The function cleanDocPath() strips certain characters but fails to neutralize '../' sequences, allowing attackers to traverse directories. The target path is constructed without verifying it remains within the documents directory, enabling arbitrary file operations on .md files anywhere on the host filesystem. In default deployments where the Management API is unauthenticated and exposed, remote unauthenticated attackers can exploit this to read, create, overwrite, or delete files and directories, potentially exposing sensitive data or enabling further code execution. The issue is resolved in version 0.30.0.