CVE-2026-57171: Trestle is vulnerable to arbitrary file write via path traversal in author generate commands (Incomplete fix of CVE-2026-46345)
At a glance
Actor: attacker who controls the -o/–output argument to trestle author {catalog,profile,ssp}-generate (e.g. via a CI pipeline that derives the output directory from repository-controlled data)
Primitive: attacker-controlled –output value reaches trestle_root / args.output write sink with only is_directory_name_allowed() (parts[0]-only task-name-collision check), not the PathSecurityValidator.validate_local_path() guard added by the CVE-2026-46345 fix
Impact: arbitrary-location file write outside the trestle workspace as the process owner (8.4 High; conservative C:N variant 7.7, still High); with –force-overwrite, the attacker-chosen directory is first recursively deleted shutil.rmtree)
Precondition: attacker influences the -o argument in a CI/automation pipeline or multi-tenant trestle workspace running these generate subcommands
Fix: call PathSecurityValidator.validate_local_path(markdown_path, trestle_root) immediately after building markdown_path in catalog.py, ssp.py, and prof.py, mirroring the existing jinja fix
References
- github.com/advisories/GHSA-r4vp-3vw6-r2x5
- github.com/oscal-compass/compliance-trestle/commit/37ed44f5f2e074202c8eb7c2f203c05d19461cdc
- github.com/oscal-compass/compliance-trestle/commit/5335ff873a2a68eb7de43df029bea09cadff22fd
- github.com/oscal-compass/compliance-trestle/pull/2270
- github.com/oscal-compass/compliance-trestle/releases/tag/v3.12.4
- github.com/oscal-compass/compliance-trestle/releases/tag/v4.1.0
- github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-4q5v-7g7x-j79w
- github.com/oscal-compass/compliance-trestle/security/advisories/GHSA-r4vp-3vw6-r2x5
- nvd.nist.gov/vuln/detail/CVE-2026-57171
Code Behaviors & Features
Detect and mitigate CVE-2026-57171 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →