Executive brief
Compliance-Trestle is a Python tool for managing OSCAL compliance documents used by organizations to track security controls and audit requirements. Versions before 3.12.4 and 4.0.0-4.0.3 contain a server-side template injection vulnerability in how it processes Markdown files. An attacker who controls content that Trestle processes—such as a crafted compliance document or workspace file—can execute arbitrary operating system commands with the privileges of the Trestle process, potentially compromising the entire system or accessing sensitive compliance data.
Technical details
The vulnerability is a server-side template injection (SSTI) flaw in the MDCleanInclude and MDSectionInclude Jinja2 tags. These tags re-parse untrusted Markdown content as Jinja2 template source code using a non-sandboxed jinja2.Environment, allowing arbitrary template expressions. An attacker can inject Jinja2 expressions that traverse Python object internals (via dunder attributes like `__globals__`, `__builtins__`) to achieve arbitrary code execution. Attack surface includes crafted workspace Markdown files, third-party SSP documents, or YAML lookup-table values that Trestle processes. No authentication is required if the attacker can control input documents. The vulnerability is fixed in versions 3.12.4 and 4.1.0 by sandboxing the Jinja2 environment or removing unsafe template re-parsing.
Affected products
- OSCAL Compass Compliance-Trestle before 3.12.4 and 4.0.0 through 4.0.3
Timeline
- 2026-08-25: disclosed: CVE-2026-54757 published
- 2026-08-03: patched: Backport security fixes to v3 (commit 5335ff8)
- 2026-06-24: patched: Security fix merged to develop branch (commit 0f82d19)