/

CVE-2026-46345

Severity:

HIGH RISK

(8.4)

Path Traversal (CWE-22) in compliance-trestle Output

CVE-2026-46345

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-36, CWE-73

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(8.4)

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 path traversal vulnerability in compliance-trestle allows the trestle author jinja command to write generated files outside its intended workspace. An attacker who can control the -o/--output argument may cause files to be created or overwritten in other attacker-selected locations.

Affected context

The issue occurs in deployments that use the trestle author jinja command and permit an attacker or untrusted automation process to influence its output path. Insufficient validation of parent-directory traversal sequences, alternate path separators, and absolute paths can allow output to escape the designated workspace.

Exploit preconditions

  • Attack surface: The trestle author jinja command and its -o/--output argument
  • Required access: Ability to invoke the command or control the output-path argument through an integrated workflow
  • Trigger point: File generation when the selected output path is resolved and written
  • Why exploitation is possible: The application does not adequately constrain relative traversal paths, Windows-style traversal paths, or absolute paths to the intended workspace

Why this happens

The underlying bug is insufficient path validation before writing generated content. User-controlled output paths are accepted without reliably canonicalizing the path and verifying that the resolved destination remains within the permitted workspace. This behavior maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with related aspects of CWE-36: Absolute Path Traversal and CWE-73: External Control of File Name or Path.

Potential impact

  • An attacker may create or overwrite files outside the intended workspace
  • Sensitive files could be modified if the executing identity has sufficient permissions
  • Generated content could be placed in locations consumed by other tools or services
  • Workflows, configurations, or source files could be corrupted
  • The issue could contribute to broader compromise when combined with executable or privileged file locations

General mitigation guidance

Mitigation generally focuses on treating output paths as untrusted and enforcing a workspace boundary before any write occurs.

Common defensive patterns include:

  • Resolve and canonicalize the requested path before writing
  • Reject absolute paths and parent-directory traversal unless explicitly required
  • Verify that the resolved destination remains beneath an approved output directory
  • Prefer generated filenames or workspace-relative identifiers over arbitrary paths
  • Apply allowlists for permitted output locations and file types
  • Run tooling with least-privilege filesystem permissions
  • Use isolated workspaces and avoid writing with elevated privileges

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis rules for file writes using command-line or configuration-derived paths
  • Code review checks for missing canonicalization and workspace-boundary validation
  • Tests covering ../, ..\, absolute paths, symbolic links, and mixed path separators
  • Runtime monitoring for writes outside approved workspace directories
  • CI policies that require path validation helpers for user-controlled file operations
  • Automated security review tools that flag externally controlled filenames and unrestricted filesystem writes

Sources

SourceLink
github.comgithub.com/oscal-compass/compliance-trestle/commit/247fcce289f60103f3d8e28d8ec51a6986b94fb6
github.comgithub.com/oscal-compass/compliance-trestle/commit/7d107b3ac53caca7bde97a6278b23cd739d94525
github.comgithub.com/oscal-compass/compliance-trestle/security/advisories/GHSA-4q5v-7g7x-j79w
github.comgithub.com/pypa/advisory-database/tree/main/vulns/compliance-trestle/PYSEC-2026-2423.yaml

Frequently asked

questions

Exploitation is dependent on how the tooling is exposed. It may be exploitable through a remote service or automation pipeline if an attacker can influence command arguments, but local command access is generally required in standalone use.

The attacker must be able to invoke the affected command or control the -o/--output value used by a trusted process. The resulting impact also depends on the permissions of the process performing the write.

Treat output paths as untrusted, resolve them canonically, and reject any destination that falls outside a fixed, approved workspace.

Combine path-boundary validation with least-privilege execution, dedicated workspaces, comprehensive traversal test cases, and monitoring for unexpected filesystem writes.

Find out what's already
exploitable in your codebase.