Summary
CVE-2026-86775 is a path traversal vulnerability (CWE-22) in the Document API of the knowns npm package, an open-source "memory layer" service that gives AI coding agents persistent access to project documentation and context. Versions up to and including 0.29.1 fail to neutralize ../ sequences in user-supplied document paths, allowing a remote, unauthenticated attacker to read, create, overwrite, or delete arbitrary files on the host filesystem. The flaw is rated High severity (CVSS 8.8) and is fixed in version 0.30.0.
Technical details
- Root cause: The HTTP handler in
internal/server/routes/docs.gonormalizes the incoming document path via acleanDocPath()function that strips leading/trailing slashes and the.mdsuffix, but does not strip or reject../traversal sequences. - Trigger conditions:
internal/storage/doc_store.gothen constructs the on-disk file path usingfilepath.Join(ds.docsDir(), filepath.FromSlash(doc.Path)+".md")without verifying that the resulting resolved path stays inside the intended documents directory. - Attack vector: In knowns’ default deployment, the Management API is unauthenticated and bound to all network interfaces. A remote attacker can send a crafted request such as
{"path": "../../../../tmp/knowns_pwn_marker"}toPOST /api/docs, or an encoded traversal path toGET /api/docs/..., with no authentication or user interaction required. - Impact: Successful exploitation lets an attacker read sensitive files stored outside the intended documents directory (e.g., other projects’ documentation or secrets), overwrite or delete arbitrary
.mdfiles anywhere on the host, and create arbitrary directories viaos.MkdirAll. Because writes are not restricted to the project sandbox, this arbitrary-write primitive could potentially be chained toward further compromise, including code execution, depending on the deployment.
Affected software
- Vendor/Project: knowns-dev
- Package:
knowns(npm,pkg:npm/knowns) - Affected versions: All versions ≤ 0.29.1
- Fixed version: 0.30.0 (and later)
Severity
- CVSS v3.1 Base Score: 8.6 (High) —
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:L - CVSS v4.0 Base Score: 8.8 (High) —
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N - Attack vector: Network, no privileges or user interaction required.
Mitigation and recommended actions
- Immediate: Upgrade the
knownsnpm package to version 0.30.0 or later, which fixes the path validation logic to properly contain document paths within the documents directory. - If immediate patching is not possible:
- Do not expose the knowns Management/Document API on untrusted networks or bind it to all interfaces; restrict it to localhost or place it behind authentication and a firewall/VPN.
- Monitor and restrict outbound file operations from the service account running knowns to the minimum required directories.
- Audit logs for requests to
/api/docscontaining../or encoded traversal sequences, and for unexpected.mdfiles created/modified/deleted outside the expected documents directory.

