CVE-2026-57170: Compliance-trestle server-side template injection in Jinja2 tags

CVE-2026-57170 · Severity: high · CVSS 7.8 · Published 2026-08-26

Compliance-trestle is a Python tool for managing OSCAL compliance documents that uses Jinja2 templating. The tool's custom Markdown include tags fail to properly sanitize attacker-controlled content, allowing an attacker to inject malicious template code that executes with full system permissions. This can lead to arbitrary code execution when compliance documents containing malicious code are processed.

Technologies: compliance-trestle (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-57170 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-57170 being exploited in the wild.
How severe is CVE-2026-57170?
High severity, with a CVSS score of 7.8, published 26 August 2026.
Which products and versions are affected?
compliance-trestle (PyPI) ECOSYSTEM:introduced=0,fixed=3.12.4, ECOSYSTEM:introduced=0,fixed=3.12.4,introduced=4.0.0,fixed=4.1.0.
Is there a fix for CVE-2026-57170?
Yes. compliance-trestle (PyPI): upgrade to 3.12.4, 4.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-57170 attacked?
It is attacked over the network.
Am I affected by CVE-2026-57170?
Check whether you run compliance-trestle (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • compliance-trestle (PyPI): upgrade to 3.12.4, 4.1.0 or later
    pip install "compliance-trestle>=4.1.0"

Technical details

The vulnerability is a server-side template injection (SSTI) in the MDSectionInclude and MDCleanInclude custom Jinja2 tags located in Trestle/core/jinja/tags.py. These tags re-parse included Markdown file content as Jinja2 template code using a plain jinja2.Environment instead of a SandboxedEnvironment, providing access to the full SSTI gadget chain. Attacker-controlled OSCAL data (control statements, component descriptions, prose fields) containing Jinja2 syntax is emitted verbatim into Markdown files without proper neutralization, then executed when the include tags re-parse the content. The vulnerability affects versions prior to 3.12.4 and 4.0.0 through 4.0.3, with no authentication or special network access required—only the ability to supply malicious OSCAL compliance data. The fix is available in version 4.1.0.

Affected products

  • OSCAL Compass Compliance-trestle before 3.12.4, 4.0.0 through 4.0.3

Identifiers

  • CVE-2026-57170
  • GHSA-mr95-65j8-9mxp
  • PYSEC-2026-4029

Timeline

  • 2026-08-26: disclosed
  • 2026-08-03: patched: Fix released in version 4.1.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.