{"id":"CVE-2026-46345","aliases":["CVE-2026-46345","GHSA-4q5v-7g7x-j79w","PYSEC-2026-2423"],"related":["CVE-2026-57171"],"kind":"vulnerability","state":"published","title":"compliance-trestle - jinja has an Arbitrary File Write via Path Traversal","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"**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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-28T17:44:03.000Z","modified":"2026-10-23T16:10:00.313Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":8.4,"rating":"HIGH"}],"cwes":["CWE-22","CWE-36","CWE-73"],"affected":[{"ranges":[{"version":">= 4.0.0, < 4.0.3","status":"affected"},{"version":"< 3.12.2","status":"affected"}],"vendor":"oscal-compass","product":"compliance-trestle","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0","status":"affected","fixed":"4.0.3"}],"ecosystem":"PyPI","package":"compliance-trestle","purl":"pkg:pypi/compliance-trestle","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.12.2"}],"ecosystem":"PyPI","package":"compliance-trestle","purl":"pkg:pypi/compliance-trestle","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.12.2"},{"type":"ecosystem","introduced":"4.0.0","status":"affected","fixed":"4.0.3"}],"ecosystem":"PyPI","package":"compliance-trestle","purl":"pkg:pypi/compliance-trestle","source":"pysec"}],"references":[{"url":"https://github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-4q5v-7g7x-j79w","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/oscal-compass/compliance-trestle/commit/247fcce289f60103f3d8e28d8ec51a6986b94fb6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/oscal-compass/compliance-trestle/commit/7d107b3ac53caca7bde97a6278b23cd739d94525","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/compliance-trestle/PYSEC-2026-2423.yaml","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46345","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/oscal-compass/compliance-trestle","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/compliance-trestle","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-4q5v-7g7x-j79w","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-08-17T18:03:21.229Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46345","url":"https://www.cve.org/CVERecord?id=CVE-2026-46345","licence":"CVE Terms of Use","modified":"2026-08-17T18:03:44.422Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4q5v-7g7x-j79w","url":"https://github.com/advisories/GHSA-4q5v-7g7x-j79w","licence":"CC-BY-4.0","modified":"2026-08-27T04:10:58.938Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46345","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46345","licence":"Public domain","modified":"2026-10-23T16:10:00.313Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2423","url":"https://osv.dev/vulnerability/PYSEC-2026-2423","licence":"CC-BY-4.0","modified":"2026-07-13T16:31:32.600Z"}],"updatedAt":"2026-11-25T22:59:33.366Z","epss":{"score":0.00204,"percentile":0.05877,"date":"2026-11-30T12:00:22.000Z"}}