The vulnerability exists in WeasyPrint's default_url_fetcher function, which is responsible for fetching external resources like images or stylesheets referenced in an HTML document. The core of the issue is a Time-of-Check to Time-of-Use (TOCTOU) flaw related to how HTTP redirects are handled. Developers could use a custom url_fetcher to implement security policies, such as blocking requests to internal IP addresses. However, this check was only performed on the initial URL provided. If that URL responded with an HTTP redirect (e.g., 301, 302), the underlying fetching mechanism would automatically follow the redirect to the new location without re-subjecting the new URL to the security validation. An attacker could exploit this by crafting a URL to a server they control which passes the initial validation, and then having that server redirect the request to a sensitive internal endpoint (e.g., http://localhost:8080/admin or a cloud metadata service). The patch addresses this vulnerability by modifying the default_url_fetcher to explicitly disable redirects by passing allow_redirects=False to the URLFetcher instance it creates. This ensures that any redirect attempts are not followed, thereby closing the SSRF loophole.