CVE-2026-46345: Compliance trestle Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-4q5v-7g7x-j79w
CVSS 8.4
CWE-73 CWE-36 CWE-22
Published
Advisory Summary

CVE-2026-46345 is a HIGH (CVSS 8.4) path traversal vulnerability (CWE-73: External Control of File Name or Path) affecting Compliance trestle libraries in the PyPI ecosystem. The issue involves compliance-trestle - jinja has an arbitrary file write via path traversal. Remediation is available by upgrading affected packages to version 4.0.3, 3.12.2.

CVE-2026-46345 at a Glance

CVE Identifier CVE-2026-46345
GHSA Identifier GHSA-4q5v-7g7x-j79w
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Compliance trestle
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-46345

To remediate this vulnerability, upgrade all affected Compliance trestle dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

compliance-trestle fixed: 4.0.3
pip install compliance-trestle>=4.0.3
compliance-trestle fixed: 3.12.2
pip install compliance-trestle>=3.12.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show compliance-trestle

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-46345, inspect your installed packages using pip:

pip show compliance-trestle

Analyze the terminal output to locate any version of Compliance trestle in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.3), your application is affected.

Note: The pip show compliance-trestle command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Compliance trestle, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**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.

CVE-2026-46345 Affected Compliance trestle Versions

2 component(s)
Fixed Versions:
4.0.33.12.2
Product / Package Ecosystem Affected Versions Fixed Version
compliance-trestle
PyPI
≥ 4.0.0
< 4.0.3
4.0.3
compliance-trestle
PyPI
< 3.12.2
3.12.2

References

Frequently Asked Questions

What is CVE-2026-46345?
CVE-2026-46345 is a security vulnerability in Compliance trestle involving compliance-trestle - jinja has an Arbitrary File Write via Path Traversal under CWE-73: External Control of File Name or Path.
Which Compliance trestle versions are affected?
Affected versions include releases prior to 4.0.3, 3.12.2 across affected packages: compliance-trestle.
What version fixes CVE-2026-46345?
Upgrading to 4.0.3, 3.12.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is compliance-trestle affected?
Yes, compliance-trestle is affected in releases prior to 4.0.3, 3.12.2. Upgrade your dependency to 4.0.3, 3.12.2 or later.
What is the CVSS score of CVE-2026-46345?
CVE-2026-46345 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-46345?
CVE-2026-46345 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check PyPI dependencies for CVE-2026-46345?
Run the dependency tree command: 'pip show compliance-trestle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4q5v-7g7x-j79w",
  "modified" : "2026-08-17T17:54:42Z",
  "published" : "2026-05-28T17:44:03Z",
  "aliases" : [ "CVE-2026-46345" ],
  "summary" : "compliance-trestle - jinja has an Arbitrary File Write via Path Traversal",
  "details" : "**Relevant Products/Components:**\n\n* `trestle/core/commands/author/jinja.py`\n* `trestle author jinja`\n\n---\n\n## Detailed Description:\n\nThe `-o/--output` argument in `trestle author jinja` allows writing files outside the intended workspace.\n\nThe application does not properly validate:\n\n* `../`\n* `..\\`\n* absolute paths\n\nThis allows arbitrary file write to attacker-controlled locations.\n\nVulnerable code:\n\n```python\noutput_file = trestle_root / r_output_file\n```\n\nAn attacker can overwrite files such as:\n\n* `.github/workflows/*.yml`\n* `.git/hooks/*`\n* user writable config files\n\nThis can lead to CI/CD compromise or local code execution.\n\n---\n\n## Steps To Reproduce:\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/oscal-compass/compliance-trestle.git\ncd compliance-trestle\n```\n\n2. Create template:\n\n```bash\necho \"hello\" > template.j2\n```\n\n3. Run:\n\n```powershell\ntrestle author jinja -i template.j2 -o \"subdir\\..\\..\\..\\..\\..\\poc.txt\"\n```\n\n4. Observe:\n\n```powershell\ndir E:\\poc.txt\n```\n\nThe file is written outside the repository workspace.\n\n---\n\n## Browsers Verified In:\n\nNot browser related.\n\nTested on:\n\n* Windows 11\n* Python 3.13\n\n---\n\n## Supporting Material/References:\n\nAffected file:\n\n```text\ntrestle/core/commands/author/jinja.py\n```\n\nSuccessfully verified:\n\n* directory traversal using `../`\n* Windows traversal using `..\\`\n* arbitrary file write outside workspace\n\n---\n\n## Access Vector Required for Exploitation:\n\nLocal\n\n---\n\n## Vulnerability Exists in Default Configuration?:\n\nYes\n\n---\n\n## Is the exploitation trivial or does it involve a multi-step process that may depend on user/victim interaction?:\n\nTrivial.\nSingle command execution.\n\n---\n\n## Exploitation Requires Authentication?:\n\nNo\n\n---\n\n## Under what privileges does the vulnerable service or component run?:\n\nRuns with privileges of the user executing the `trestle` command.\n\n## Impact\n\nAn attacker can write files outside the intended workspace directory and overwrite sensitive files writable by the current user.\n\nPossible impacts include:\n\n* overwriting `.github/workflows/*.yml` to execute attacker-controlled GitHub Actions workflows\n* overwriting `.git/hooks/*` for local code execution\n* modifying user configuration files such as `.bashrc`\n* tampering with repository files and generated compliance artifacts\n\nIn CI/CD environments, this may result in execution of attacker-controlled commands on build runners.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "compliance-trestle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "compliance-trestle"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.12.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.12.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-4q5v-7g7x-j79w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-46345"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/oscal-compass/compliance-trestle/commit/247fcce289f60103f3d8e28d8ec51a6986b94fb6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/oscal-compass/compliance-trestle/commit/7d107b3ac53caca7bde97a6278b23cd739d94525"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/oscal-compass/compliance-trestle"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/compliance-trestle/PYSEC-2026-2423.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-36", "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-28T17:44:03Z",
    "nvd_published_at" : null
  }
}