cve.bz

CVE-2026-57170 oscal-compass compliance-trestle: Code Injection

7.8 highEPSS 0.2%Fix available

High (7.8) in oscal-compass compliance-trestle. EPSS 0.2% estimated probability of exploitation activity in the next 30 days. Fixed in compliance-trestle 3.12.4, 4.1.0.

On this page
Compliance-trestle (Trestle) is a Python SDK and command-line tool for managing OSCAL compliance documents. In 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 the content of an included Markdown file as Jinja2 template code in a non-sandboxed environment, allowing server-side template injection that can lead to arbitrary code execution. The MDSectionInclude and MDCleanInclude tags in Trestle/core/jinja/tags.py pass included file content to Parser(self.environment, ...).parse(), splicing it into the host template's compilation, and the environment is a plain jinja2.Environment rather than a SandboxedEnvironment, so any expressions in the file are evaluated with full access to the usual SSTI gadget chain. Because Trestle's Markdown writers emit OSCAL prose and component-description fields verbatim, applying delimiter neutralization only to parameter tables, attacker-controlled OSCAL data such as a control statement, part prose, or component description containing Jinja2 syntax flows into an included Markdown file and is executed when the include tag re-parses it. This issue is fixed in version 4.1.0.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 15th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-08-28. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-94 Improper Control of Generation of Code (Code Injection)
CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • compliance-trestle (PyPI): fixed in 3.12.4, 4.1.0

Ask an AI about this CVE

Show the promptExplain CVE-2026-57170 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-57170?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-57170?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-57170 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
oscal-compass compliance-trestle< 3.12.4
oscal-compass compliance-trestle>= 4.0.0, < 4.1.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-mr95-65j8-9mxpPyPIcompliance-trestle<3.12.43.12.4
GHSA-mr95-65j8-9mxpPyPIcompliance-trestle>=4.0.0 <4.1.04.1.0
PYSEC-2026-4029PyPIcompliance-trestle<3.12.4
>=4.0.0 <4.1.0
3.12.4, 4.1.0

Red Hat

Red Hat rates this Important.

Red Hat's statement

An IMPORTANT impact Server-Side Template Injection (SSTI) flaw was found in compliance-trestle, a Python SDK and command-line tool for managing OSCAL compliance documents. The custom Jinja2 include tags mdsection_include and md_clean_include re-parse the content of included Markdown files as Jinja2 template code in a non-sandboxed Jinja2 environment. An attacker who can control OSCAL data that is rendered into an included Markdown file, such as a control statement, part prose, or a component description, can embed Jinja2 syntax that is evaluated when the include tag re-parses the file, resulting in arbitrary code execution in the context of the user processing the OSCAL content (CVSS 3.1: 7.8, AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). Red Hat products are not affected by this flaw: the two Red Hat products initially linked to this component, the File Integrity Operator compliance content container image and the scap-security-guide package in Red Hat hardened images, consume compliance-trestle only as a build-time dependency when generating compliance content, and the responsible teams assessed the shipped artifacts as not affected because the vulnerable component is not present in them.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability. Upstream has fixed this issue in compliance-trestle 3.12.4 and 4.1.0, so users of the upstream project should upgrade to a fixed version. No Red Hat products ship the vulnerable component, so no Red Hat-specific update is required.

ProductPackageStateAdvisory
File Integrity Operatorcompliance/openshift-compliance-content-rhel8Not affected
Red Hat Hardened Imagesscap-security-guideNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-57170.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON