High

compliance-trestle - jinja has an Arbitrary File Write via Path Traversal

  • Disclosed: 28.05.2026
  • Updated: 11.10.2026 15:17

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
  1. Create template:
bash
echo "hello" > template.j2
  1. Run:
powershell
trestle author jinja -i template.j2 -o "subdir\..\..\..\..\..\poc.txt"
  1. 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:

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) compliance-trestle >= 4.0.0, < 4.0.3, < 3.12.2 4.0.3, 3.12.2

References

CVSS score 8.4/10
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-22, CWE-36, CWE-73
Platform
Python (PyPI)
Package
compliance-trestle
Disclosed
28.05.2026
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-2423 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-4q5v-7g7x-j79w - CC BY 4.0

Vulnerability history: compliance-trestle

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (9) in the archive
Total entries
9
First → latest
05.2026 09.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 7
  • Medium 2

Disclosures per year

  1. 2026: 9
Severity:
  1. High · 7.8 CVE-2026-57170 < 3.12.4, >= 4.0.0, < 4.1.0 3.12.4, 4.1.0
  2. High · 7.8 CVE-2026-54757 < 3.12.4, >= 4.0.0, < 4.1.0 3.12.4, 4.1.0
  3. High · 7.8 CVE-2026-46439 < 3.12.2, >= 4.0.0, < 4.0.3 3.12.2, 4.0.3
  4. compliance-trestle - jinja has an Arbitrary File Write via Path Traversal this entry
    High · 8.4 CVE-2026-46345 >= 4.0.0, < 4.0.3, < 3.12.2 4.0.3, 3.12.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.