CVE-2026-57170: CWE-94: Improper Control of Generation of Code ('Code Injection') in oscal-compass compliance-trestle
Description
Compliance-trestle versions prior to 3.12.4 and 4.0.0 through 4.0.3 contain a server-side template injection vulnerability due to improper handling of Jinja2 include tags. These tags re-parse included Markdown files as Jinja2 templates in a non-sandboxed environment, allowing arbitrary code execution. The issue is fixed in version 4.1.0.
CVSS v3.1
Score 7.8high
Affected software
oscal-compass
compliance-trestle
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Compliance-trestle is a Python SDK and CLI tool for managing OSCAL compliance documents. In affected versions prior to 3.12.4 and 4.0.0 through 4.0.3, the custom Jinja2 include tags mdsection_include and md_clean_include re-parse included Markdown content as Jinja2 template code without sandboxing. This allows server-side template injection (SSTI) because the environment used is a plain jinja2.Environment rather than a SandboxedEnvironment. As a result, attacker-controlled OSCAL data containing Jinja2 syntax can be executed during template rendering, leading to arbitrary code execution. The vulnerability is addressed in version 4.1.0.
Potential Impact
Successful exploitation allows an attacker with at least local privileges to execute arbitrary code on the host system via server-side template injection. This can lead to full compromise of the affected system, including confidentiality, integrity, and availability impacts as indicated by the CVSS vector (C:H/I:H/A:H).
Mitigation Recommendations
Upgrade to compliance-trestle version 4.1.0 or later, where this vulnerability is fixed by using a sandboxed Jinja2 environment for template parsing. Patch status is not explicitly confirmed in the advisory, but the fix is stated to be in version 4.1.0. Until upgrade, avoid processing untrusted OSCAL data that could contain malicious Jinja2 syntax in included Markdown files.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-24T01:47:55.285Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a8e23c2acd9273b49d60c52
Added to database: 08/25/2026, 23:22:42 UTC
Last enriched: 09/09/2026, 20:37:14 UTC
Last updated: 10/09/2026, 06:48:18 UTC
Views: 59
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.