Summary
CVE-2026-86542 is a path traversal vulnerability in the "knowns" npm package (knowns-dev/knowns), a memory/documentation layer for AI-native development tooling that exposes a REST API for managing imported content. Versions prior to 0.30.0 fail to validate the name parameter supplied to the import API, allowing an unauthenticated remote attacker to escape the intended imports directory and write or overwrite arbitrary files on the host running the server. The issue carries a CVSS v3.1 base score of 9.1 (Critical).
Technical details
- Root cause: The import routes (
internal/server/routes/imports.go) build the destination path for imported content by directly joining the attacker-controllednamefield from the request body with the imports directory (filepath.Join(ir.importsDir(), name)), with no post-join containment check to ensure the resolved path stays inside the imports sandbox. - Trigger conditions: An attacker sends a
POST /api/importsrequest (or triggers a git-based import viagitCloneImport) with anamevalue containing traversal sequences (e.g.../../../../tmp/...), causing files to be created or overwritten outside the imports directory. - Attack vector: Network, no authentication or user interaction required — by default, when no password is configured for the knowns management API, its authentication middleware does not enforce access control on these endpoints, making the flaw fully remotely exploitable.
- Impact: Arbitrary file write/overwrite on the server’s filesystem (high integrity and availability impact; no direct confidentiality impact from this specific flaw). The vendor’s advisory for the same code path notes that this write primitive can be chained with a separate, related weakness in the LSP binary-override handling (patched in the same release) to escalate to remote code execution.
Affected software
- Product: knowns (npm package), vendor knowns-dev
- Affected versions: All versions prior to 0.30.0 (
< 0.30.0) - Fixed version: 0.30.0 and later
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H - (A CVSS v4.0 score of 8.8, High, is also published for this CVE with vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N.)
Mitigation and recommended actions
- Immediate: Upgrade knowns to version 0.30.0 or later, which validates import names and rejects traversal sequences before constructing destination paths.
- If immediate patching is not possible:
- Restrict network access to the knowns management/REST API to trusted hosts only (e.g., via firewall rules or a reverse proxy), since the API is unauthenticated by default when no password is configured.
- Configure a management API password/authentication if supported by your deployed version, to reduce unauthenticated exposure.
- Avoid running the knowns server process with elevated filesystem privileges, to limit the blast radius of any arbitrary file write.
- Monitor for unexpected file writes outside the
.knowns/importsdirectory and audit recent import API calls for suspiciousnamevalues containing../sequences.

