compliance-trestle
Affected
- introduced
4.0.0, fixed4.0.3(ecosystem)
Fixed versions
4.0.3
Fix
- Fixed version
4.0.3pip install --upgrade compliance-trestle==4.0.3
Advisory
Also known as: CVE-2026-46345, PYSEC-2026-2423
compliance-trestle - jinja has an Arbitrary File Write via Path Traversal
Relevant Products/Components:
trestle/core/commands/author/jinja.pytrestle 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:
../..\This allows arbitrary file write to attacker-controlled locations.
Vulnerable code:
output_file = trestle_root / r_output_file
An attacker can overwrite files such as:
.github/workflows/*.yml.git/hooks/*This can lead to CI/CD compromise or local code execution.
---
Steps To Reproduce:
git clone https://github.com/oscal-compass/compliance-trestle.git
cd compliance-trestle
echo "hello" > template.j2
trestle author jinja -i template.j2 -o "subdir\..\..\..\..\..\poc.txt"
dir E:\poc.txt
The file is written outside the repository workspace.
---
Browsers Verified In:
Not browser related.
Tested on:
---
Supporting Material/References:
Affected file:
trestle/core/commands/author/jinja.py
Successfully verified:
../..\---
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:
.github/workflows/*.yml to execute attacker-controlled GitHub Actions workflows.git/hooks/* for local code execution.bashrcIn CI/CD environments, this may result in execution of attacker-controlled commands on build runners.
High Basis: The source's own band: HIGH
4.0.0, fixed 4.0.3 (ecosystem)4.0.3
4.0.3pip install --upgrade compliance-trestle==4.0.30, fixed 3.12.2 (ecosystem)3.12.2
3.12.2pip install --upgrade compliance-trestle==3.12.2Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0