The vulnerability is a Server-Side Request Forgery (SSRF) in Weblate's asset fetching mechanism, specifically when handling URL-based screenshot uploads and remote HTML file fetching for the CDN addon. The ALLOWED_ASSET_DOMAINS setting was intended to restrict asset downloads to a list of trusted domains. However, the validation was only performed on the initial URL provided by the user. The underlying HTTP client would automatically follow HTTP redirects without re-validating the new destination URL against the allowlist.
An authenticated attacker could exploit this by providing a URL from an allowed domain that redirects to a resource on a different, potentially internal or malicious, domain. This would cause the Weblate server to issue a request to the arbitrary domain, bypassing the intended security control.
The analysis of the patch 8be80625a864c8db5854503872a65e8a0b7399a6 reveals the fix and pinpoints the vulnerable code locations:
-
A new utility function, weblate.utils.requests.asset_request, was introduced. This function replaces the standard requests call and implements a manual redirect-following loop. Within this loop, it explicitly calls weblate.utils.validators.validate_asset_url for each URL in the redirect chain, ensuring that every hop is validated against ALLOWED_ASSET_DOMAINS.
-
The weblate.screenshots.forms.ScreenshotImageValidationMixin.download_image function, which handles screenshot uploads from a URL, was modified to use the new asset_request function instead of the generic http_request. The previous, insufficient validation on just the initial URL was removed, delegating the responsibility to the new secure request handler.
-
Similarly, the weblate.addons.tasks.cdn_parse_html function, which fetches remote HTML files, was also updated to use asset_request, patching the same SSRF-via-redirect flaw in that feature.
Therefore, during exploitation, a runtime profiler would have shown calls to ScreenshotImageValidationMixin.download_image or cdn_parse_html as the entry points that trigger the vulnerable asset download.