CVE-2026-57170: Server-Side Template Injection Bypass in Compliance-Trestle Include Tags
Vulnerability ID: CVE-2026-57170
CVSS Score: 7.8
Published: 2026-09-24
Compliance-trestle is vulnerable to Server-Side Template Injection (SSTI) leading to arbitrary code execution due to an incomplete fix for CVE-2026-46439. While the original remediation removed recursive template rendering in the core system, custom include extensions ('mdsection_include' and 'md_clean_include') continued to compile and parse files via a standard, non-sandboxed Jinja2 environment. This allows attackers who can inject template expressions into OSCAL documents or markdown files to execute arbitrary python code when the custom template processing is executed. The issue has been patched in versions 4.1.0 and 3.12.4.
TL;DR
An incomplete security patch for CVE-2026-46439 in compliance-trestle allowed attackers to execute arbitrary shell commands via Server-Side Template Injection (SSTI) by placing payloads inside customized template include tags. It was remediated by applying a SandboxedEnvironment and neutralizing delimiters.
⚠️ Exploit Status: POC
Technical Details
- CWE ID: CWE-1336 / CWE-94
- Attack Vector: Local (AV:L)
- CVSS Score: 7.8 (High)
- EPSS Score: 0.00235
- EPSS Percentile: 12.82%
- Exploit Status: poc
- KEV Status: Not Listed
Affected Systems
- compliance-trestle toolchain
- NIST OSCAL documentation building environments
- Automated compliance validation platforms using python-trestle
-
compliance-trestle: < 3.12.4 (Fixed in:
3.12.4) -
compliance-trestle: >= 4.0.0, < 4.1.0 (Fixed in:
4.1.0)
Code Analysis
Commit: 0f82d19
Fix custom tag parser evaluation by compiling within a SandboxedEnvironment, and implement delimiter neutralizing for documentation writers.
Commit: 5335ff8
Backport of the sandboxed parsing security corrections and bracket neutralization filters to the v3.x maintenance release line.
Mitigation Strategies
- Upgrade compliance-trestle dependencies to patched versions (4.1.0 or 3.12.4)
- Implement strict branch protection rules with review gates blocking commits with raw Jinja2 delimiters in OSCAL documents
- Run documentation assembly processes within isolated sandboxed build environments with restricted local system permissions and minimal network access
Remediation Steps:
- Audit local python development environments and virtual environments using 'pip list | grep compliance-trestle'
- Update project requirements files, lockfiles, or pyproject.toml configurations to restrict versions to >= 4.1.0 or >= 3.12.4
- Execute 'pip install --upgrade compliance-trestle' within the production and runner environments
- Verify build pipelines run without containing environment variable tokens in contexts accessible to documentation building blocks
References
Read the full report for CVE-2026-57170 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)