CVE-2026-52776: compliance-trestle has an URLSecurityValidator SSRF allowlist bypass via IPv4-mapped IPv6 and 0.0.0.0
compliance-trestle 4.0.3 (latest) ships an URLSecurityValidator in trestle/core/remote/security.py to block SSRF to loopback / link-local / cloud-metadata endpoints from the HTTPSFetcher and SFTPFetcher remote-fetch paths. The allowlist is incomplete and can be bypassed by four equivalent address representations that resolve to the same blocked host but evade the validator’s checks:
- IPv4-mapped IPv6 literals (
[::ffff:169.254.169.254],[::ffff:127.0.0.1],[::ffff:10.0.0.1]) are returned bysocket.getaddrinfoasIPv6Addressobjects;IPv6Address in IPv4Network('169.254.0.0/16')returnsFalse, so the_check_blocked_networksand_check_private_networkspredicates do not match. - IPv4 unspecified address
0.0.0.0is not inALWAYS_BLOCKED_NETWORKS(which covers127.0.0.0/8but not0.0.0.0/8); on Linux + Docker,0.0.0.0routes to local services on any interface, and on dual-stack-mapped sockets it also reaches loopback listeners.
A malicious OSCAL profile referencing one of these URLs in imports[*].href or back-matter.resources[*].rlinks[*].href causes HTTPSFetcher.__init__ and _do_fetch (which both invoke validator.validate_url) to pass the URL through to requests.get, contacting cloud-metadata services, loopback admin interfaces, or RFC 1918 internal networks (with TRESTLE_BLOCK_PRIVATE_IPS=true set) that the validator was specifically designed to block.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-52776 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 →