The analysis of the security patch for CVE-2026-31959 in anchore/quill reveals a Server-Side Request Forgery (SSRF) vulnerability. The root cause is the lack of input validation on URLs received from external sources before making HTTP requests.
The primary vulnerable function is notary.APIClient.submissionLogs. This function is responsible for fetching Apple notarization logs. The vulnerable code path took a URL from the DeveloperLogURL attribute of an Apple API response and passed it directly to http.Get. This allows an attacker, who can control the API response (e.g., via a compromised TLS-intercepting proxy), to force the Quill application to make requests to arbitrary internal or external services. This could be used to exfiltrate cloud credentials or scan internal networks.
A secondary, similar vulnerability was identified in the generate.download function, an internal tool for downloading PKI certificates. This function also used http.Get on URLs without prior validation.
The patch addresses these issues by introducing a URL validation module (internal/urlvalidate). This validator is now used before any HTTP requests are made to externally-provided URLs. It employs a multi-tiered approach:
- An allowlist for known trusted domains (e.g.,
*.apple.com).
- A denylist for dangerous targets like loopback, private, and link-local IP addresses (including cloud metadata endpoints).
- A warning mechanism for any other unexpected domains.
This fix is applied in two key places: a new getUnauthenticated method in the httpClient for the notarization log fetching, and within a custom http.Client's CheckRedirect function to prevent SSRF via HTTP redirects. This ensures that both direct requests and any subsequent redirects are properly validated, effectively mitigating the SSRF risk.