/

CVE-2026-30633

Severity:

HIGH RISK

(7.5)

Directory Traversal (CWE-22) in Knowns Document Tools

CVE-2026-30633

Deferred

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Access and Modification

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A directory traversal flaw in Knowns 0.11.4 allows crafted path values to the get_doc and update_doc tools to access files outside the intended document directory.

When user-controlled paths are not properly constrained, an attacker can read or modify arbitrary files on the server within the process permissions.

Affected context

This vulnerability appears in deployments of the Knowns application that expose the get_doc and update_doc tools to user input, either via HTTP APIs, CLIs, or internal integrations.

It manifests when path parameters supplied by a user or external system are accepted and combined with filesystem operations without strong normalization and restriction to a trusted base directory.

Environments where the application runs with access to sensitive configuration, log, or data files are at heightened risk.

Exploit preconditions

  • Attack surface: Interfaces that invoke get_doc or update_doc with user-supplied path values (e.g., web endpoints, service APIs, automation scripts).
  • Required access: Ability to submit or influence the path parameter used by these tools; this may be authenticated or unauthenticated depending on deployment.
  • Trigger point: File read or write operations performed using the crafted path, typically when fetching or updating a document.
  • Why exploitation is possible: The implementation trusts the provided path and does not sufficiently prevent traversal sequences from escaping the intended document root directory.

Why this happens

The core issue is the use of unvalidated and unsanitized path input in filesystem operations, which maps directly to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

The get_doc and update_doc tools likely concatenate user-controlled path fragments with a base directory and perform file access without enforcing strict checks for traversal tokens, absolute paths, or symlink resolution.

This pattern allows attackers to bypass logical directory boundaries and target arbitrary files that the application process can access.

Potential impact

  • An attacker may read sensitive files such as configuration, credentials, or access tokens.
  • An attacker could overwrite or corrupt application data or logs, impacting integrity and availability.
  • An attacker may modify files used by the application at runtime, potentially enabling further compromise.
  • An attacker could gain insight into system structure, aiding reconnaissance for additional attacks.

General mitigation guidance

Effective mitigation focuses on constraining file access to explicit, well-defined directories and never trusting raw path input.

Common defensive patterns include:

  • Normalizing and canonicalizing paths, then verifying they remain within a configured root (e.g., using allowlisted base directories).
  • Rejecting traversal sequences (../), absolute paths, or unexpected path prefixes and enforcing strict filename patterns where possible.
  • Decoupling user-facing identifiers from direct filesystem paths (e.g., using IDs or keys mapped to known-safe locations).
  • Running the application with least-privilege filesystem permissions so that even if traversal occurs, accessible data is minimized.
  • Centralizing file access routines behind a hardened API to avoid ad hoc path handling throughout the codebase.

How teams detect issues like this

Detection typically involves a mix of code-level inspection and runtime monitoring.

Useful approaches include:

  • Static analysis rules that flag uses of user-controlled path variables in file operations without prior normalization and boundary checks.
  • Code review practices that require verification of path handling logic, focusing on enforcement of a root directory and rejection of traversal patterns.
  • Security tests that attempt directory traversal via the get_doc and update_doc interfaces to confirm that access is constrained.
  • Policy-based enforcement that mandates the use of shared, vetted filesystem helper utilities rather than direct calls to low-level file APIs.

Sources

SourceLink
gist.github.comgist.github.com/spdc-elm/5e19d66402307bdfc8b25ab27469172f
github.comgithub.com/knowns-dev/knowns/commit/62fb0daaa0b9e66fce1d42c02b5bb519367cf669

Frequently asked

questions

Yes, if the get_doc and update_doc tools are exposed through remote interfaces such as web APIs or services, an attacker can supply crafted paths from afar.

The attacker must be able to influence the path parameter passed into these tools. In many deployments this may require an authenticated account, but in others it could be exposed publicly.

Constrain all path usage to a predefined document root, normalize the requested path, and reject any input that attempts to leave that directory or contains traversal sequences, absolute paths, or unexpected characters.

Standardize on secure file access helpers, avoid building paths directly from user input, apply rigorous validation and canonicalization to path parameters, and include path traversal checks in code review and automated security testing.

Find out what's already
exploitable in your codebase.