8.4high
compliance-trestle - jinja has an Arbitrary File Write via Path Traversal
- Severity
- 8.4high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.20% (higher than 6% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-4q5v-7g7x-j79wPYSEC-2026-2423
Description
compliance-trestle is a tooling platform for managing compliance as code. Prior to versions 3.12.2 and 4.0.3, the `-o/--output` argument in `trestle author jinja` allows writing files outside the intended workspace. The application does not properly validate, `../`, `..\`, or absolute paths. This allows arbitrary file write to attacker-controlled locations. Versions 3.12.3 and 4.0.3 patch the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| oscal-compass compliance-trestle | >= 4.0.0, < 4.0.3, < 3.12.2 | CVE List |
| compliance-trestle (PyPI) | from 4.0.0 before 4.0.3, before 3.12.2 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 8.4high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 8.4high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | 8.4high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
What each source says
CVE List
compliance-trestle is a tooling platform for managing compliance as code. Prior to versions 3.12.2 and 4.0.3, the `-o/--output` argument in `trestle author jinja` allows writing files outside the intended workspace. The application does not properly validate, `../`, `..\`, or absolute paths. This allows arbitrary file write to attacker-controlled locations. Versions 3.12.3 and 4.0.3 patch the issue.
GitHub Advisory Database
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:
../..\- absolute paths
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/*- user writable config files
This can lead to CI/CD compromise or local code execution.
Steps To Reproduce:
- Clone the repository:
git clone https://github.com/oscal-compass/compliance-trestle.git
cd compliance-trestle
- Create template:
echo "hello" > template.j2
- Run:
trestle author jinja -i template.j2 -o "subdir\..\..\..\..\..\poc.txt"
- Observe:
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:
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/*.ymlto 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.
NVD (es)
compliance-trestle es una plataforma de herramientas para gestionar el cumplimiento como código. Antes de las versiones 3.12.2 y 4.0.3, el argumento ’-o/--output’ en ’trestle author jinja’ permite escribir archivos fuera del espacio de trabajo previsto. La aplicación no valida correctamente ’.. / ’, ’.. / ’, o rutas absolutas. Esto permite la escritura arbitraria de archivos en ubicaciones controladas por el atacante. Las versiones 3.12.3 y 4.0.3 parchean el problema.
References
Related
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-46345 changed 2026-08-17 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4q5v-7g7x-j79w changed 2026-08-27 | CC-BY-4.0 |
| NVD | CVE-2026-46345 changed 2026-10-23 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2423 changed 2026-07-13 | CC-BY-4.0 |