/

CVE-2026-30632

Severity:

HIGH RISK

(7.5)

Directory Traversal (CWE-22) in Knowns create_doc Tool

CVE-2026-30632

Deferred

Vulnerability type

Category:

Directory Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read/Write via Path Traversal

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 vulnerability in the Knowns create_doc tool allows attackers to manipulate folder names to traverse out of intended directories.

By supplying crafted folder name values, an attacker may gain access to or overwrite files outside the expected document root, especially in deployments that expose this tooling or automate document generation.

Affected context

This vulnerability appears in environments where the Knowns 0.11.4 create_doc tool accepts folder names from user input, configuration, or automated workflows.

The risk is elevated when create_doc is exposed via web interfaces, CLI wrappers, CI pipelines, or other automation that processes partially trusted or user-controllable folder parameters.

Systems that run create_doc with broad filesystem permissions or shared service accounts are more susceptible to impactful exploitation.

Exploit preconditions

  • Attack surface: The interface (CLI, API, web UI, or automation) through which folder names are supplied to the create_doc tool.
  • Required access: Ability to invoke create_doc or influence its folder name parameter (directly or indirectly, such as via configuration or job definitions).
  • Trigger point: Passing a crafted folder name containing traversal sequences (for example, segments intended to move up the directory tree) into the tool.
  • Why exploitation is possible: The tool appears to concatenate user-influenced folder names into filesystem paths without normalizing, validating, or constraining them against an allowed base directory, enabling traversal outside the intended path.

Why this happens

The underlying issue aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The create_doc tool likely constructs filesystem paths by joining a base directory with a folder name derived from external input, but fails to sanitize or normalize this input to enforce confinement within a specific root.

Without checks for traversal patterns, absolute paths, or symbolic link behavior, the tool can be tricked into reading from or writing to arbitrary locations in the filesystem that the running process can access.

Potential impact

  • Unauthorized reading of files outside the intended document directory (e.g., configuration files, keys, logs).
  • Overwriting or creation of files in arbitrary directories, which could facilitate further compromise.
  • Interference with application or system behavior by modifying configuration or content files.
  • Potential escalation of impact when combined with other weaknesses (such as log poisoning, script upload, or weak file permissions).

General mitigation guidance

Effective mitigation generally focuses on restricting how paths are constructed and validated within file-handling components:

  • Constrain all folder name values to a predefined base directory and reject any path that resolves outside that directory after normalization.
  • Normalize paths (resolving .., symbolic links, and redundant separators) before use and compare against an allowed root path to enforce confinement.
  • Apply strict allowlists for acceptable folder name patterns, avoiding acceptance of arbitrary or mixed path segments.
  • Run file-creation and document-generation routines under accounts with minimal filesystem privileges and limited write access.
  • Separate data directories from system and configuration directories to reduce the blast radius of any misrouted writes.

How teams detect issues like this

Organizations can detect and monitor for directory traversal weaknesses and their exploitation through several approaches:

  • Static analysis rules that flag direct concatenation of user-controlled values into filesystem paths without normalization or checks.
  • Code review practices that require explicit validation of all path parameters, including the use of canonicalization APIs and root-path checks.
  • Runtime monitoring or logging that records unexpected path patterns (such as ../ sequences or absolute paths) supplied to document-generation or file-handling tools.
  • Security testing and fuzzing that systematically probes file-handling endpoints with traversal patterns to verify protections.

Sources

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

Frequently asked

questions

It can be, depending on how the create_doc tool is exposed. If folder names are controllable via a remote interface (such as a web API or remote automation trigger), an attacker may exploit the traversal without local access.

The attacker must be able to invoke create_doc or influence its folder name parameter. This could be through authenticated or unauthenticated endpoints, scheduled jobs, or CI/CD tasks that accept external input.

The safest pattern is to canonicalize any folder name to an absolute path, verify that it remains within a designated base directory, and reject or replace any input that attempts to escape this boundary. Combining this with strict input validation and minimal filesystem privileges further reduces risk.

Adopt a development policy that forbids direct use of raw user input in filesystem paths, requires use of safe path-joining utilities, and mandates canonicalization-plus-root-check patterns. Integrating static analysis and security review checkpoints into the development lifecycle helps catch path traversal logic before release.

Find out what's already
exploitable in your codebase.