CVE-2026-46345: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in oscal-compass compliance-trestle
**Relevant Products/Components:** * `trestle/core/commands/author/jinja.py` * `trestle author jinja` --- ## Detailed Description: The `-o/--output` argument in `trestle author jinja` allows writing files outside the intended workspace. The application does not properly validate: * `../` * `..\` * absolute paths This allows arbitrary file write to attacker-controlled locations. Vulnerable code: ```python output_file = trestle_root / r_output_file ``` An attacker can overwrite files such as: * `.github/workflows/*.yml` * `.git/hooks/*` * user writable config files This can lead to CI/CD compromise or local code execution. --- ## Steps To Reproduce: 1. Clone the repository: ```bash git clone https://github.com/oscal-compass/compliance-trestle.git cd compliance-trestle ``` 2. Create template: ```bash echo "hello" > template.j2 ``` 3. Run: ```powershell trestle author jinja -i template.j2 -o "subdir\..\..\..\..\..\poc.txt" ``` 4. Observe: ```powershell dir E:\poc.txt ``` The file is written outside the repository workspace. --- ## Browsers Verified In: Not browser related. Tested on: * Windows 11 * Python 3.13 --- ## Supporting Material/References: Affected file: ```text trestle/core/commands/author/jinja.py ``` Successfully verified: * directory traversal using `../` * Windows traversal using `..\` * arbitrary file write outside workspace --- ## Access Vector Required for Exploitation: Local --- ## Vulnerability Exists in Default Configuration?: Yes --- ## Is the exploitation trivial or does it involve a multi-step process that may depend on user/victim interaction?: Trivial. Single command execution. --- ## Exploitation Requires Authentication?: No --- ## Under what privileges does the vulnerable service or component run?: Runs with privileges of the user executing the `trestle` command. ## Impact An attacker can write files outside the intended workspace directory and overwrite sensitive files writable by the current user. Possible impacts include: * overwriting `.github/workflows/*.yml` to execute attacker-controlled GitHub Actions workflows * overwriting `.git/hooks/*` for local code execution * modifying user configuration files such as `.bashrc` * tampering with repository files and generated compliance artifacts In CI/CD environments, this may result in execution of attacker-controlled commands on build runners.
AI Analysis
Technical Summary
compliance-trestle versions before 3.12.2 and 4.0.3 contain a path traversal vulnerability (CWE-22) in the handling of the `-o/--output` argument of the `trestle author jinja` command. The application fails to properly validate relative path components such as `../` or `..\` and absolute paths, enabling an attacker to write files outside the designated workspace directory. This improper limitation of pathname allows arbitrary file write to locations controlled by the attacker. The vulnerability is addressed in versions 3.12.2 and 4.0.3.
Potential Impact
Successful exploitation allows an attacker to write arbitrary files to locations outside the intended workspace, potentially leading to system compromise, data corruption, or privilege escalation depending on the environment and file system permissions. The CVSS score of 8.4 (high) reflects the significant confidentiality, integrity, and availability impacts.
Mitigation Recommendations
Upgrade compliance-trestle to version 3.12.2 or later, or 4.0.3 or later, where this path traversal vulnerability has been fixed. No other mitigations are specified. Patch status is confirmed by the version information in the advisory.
CVE-2026-46345: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in oscal-compass compliance-trestle
Description
**Relevant Products/Components:** * `trestle/core/commands/author/jinja.py` * `trestle author jinja` --- ## Detailed Description: The `-o/--output` argument in `trestle author jinja` allows writing files outside the intended workspace. The application does not properly validate: * `../` * `..\` * absolute paths This allows arbitrary file write to attacker-controlled locations. Vulnerable code: ```python output_file = trestle_root / r_output_file ``` An attacker can overwrite files such as: * `.github/workflows/*.yml` * `.git/hooks/*` * user writable config files This can lead to CI/CD compromise or local code execution. --- ## Steps To Reproduce: 1. Clone the repository: ```bash git clone https://github.com/oscal-compass/compliance-trestle.git cd compliance-trestle ``` 2. Create template: ```bash echo "hello" > template.j2 ``` 3. Run: ```powershell trestle author jinja -i template.j2 -o "subdir\..\..\..\..\..\poc.txt" ``` 4. Observe: ```powershell dir E:\poc.txt ``` The file is written outside the repository workspace. --- ## Browsers Verified In: Not browser related. Tested on: * Windows 11 * Python 3.13 --- ## Supporting Material/References: Affected file: ```text trestle/core/commands/author/jinja.py ``` Successfully verified: * directory traversal using `../` * Windows traversal using `..\` * arbitrary file write outside workspace --- ## Access Vector Required for Exploitation: Local --- ## Vulnerability Exists in Default Configuration?: Yes --- ## Is the exploitation trivial or does it involve a multi-step process that may depend on user/victim interaction?: Trivial. Single command execution. --- ## Exploitation Requires Authentication?: No --- ## Under what privileges does the vulnerable service or component run?: Runs with privileges of the user executing the `trestle` command. ## Impact An attacker can write files outside the intended workspace directory and overwrite sensitive files writable by the current user. Possible impacts include: * overwriting `.github/workflows/*.yml` to execute attacker-controlled GitHub Actions workflows * overwriting `.git/hooks/*` for local code execution * modifying user configuration files such as `.bashrc` * tampering with repository files and generated compliance artifacts In CI/CD environments, this may result in execution of attacker-controlled commands on build runners.
CVSS v3.1
Score 8.4high
Affected software
pkg:pypi/compliance-trestleRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
compliance-trestle versions before 3.12.2 and 4.0.3 contain a path traversal vulnerability (CWE-22) in the handling of the `-o/--output` argument of the `trestle author jinja` command. The application fails to properly validate relative path components such as `../` or `..\` and absolute paths, enabling an attacker to write files outside the designated workspace directory. This improper limitation of pathname allows arbitrary file write to locations controlled by the attacker. The vulnerability is addressed in versions 3.12.2 and 4.0.3.
Potential Impact
Successful exploitation allows an attacker to write arbitrary files to locations outside the intended workspace, potentially leading to system compromise, data corruption, or privilege escalation depending on the environment and file system permissions. The CVSS score of 8.4 (high) reflects the significant confidentiality, integrity, and availability impacts.
Mitigation Recommendations
Upgrade compliance-trestle to version 3.12.2 or later, or 4.0.3 or later, where this path traversal vulnerability has been fixed. No other mitigations are specified. Patch status is confirmed by the version information in the advisory.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-13T18:37:30.990Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a834becbf8831d5394ecf78
Added to database: 08/17/2026, 17:59:08 UTC
Last enriched: 08/17/2026, 18:11:45 UTC
Last updated: 08/18/2026, 01:21:54 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.