The vulnerability lies in the getImageSizeFromUrl function within the extensions/qqbot/src/utils/image-size.ts file of the OpenClaw application. The function was responsible for fetching image dimensions from a URL. The original implementation used a standard fetch call without any validation or sanitization of the provided URL. This allowed an attacker to supply a URL pointing to an internal network resource, leading to a Server-Side Request Forgery (SSRF) vulnerability. The server would then fetch content from the internal URL and potentially re-upload it, exposing internal data or services.
The patch applied in commit 08ae021d1f42905a85a550813c0d95169b171a6c addresses this issue by replacing the raw fetch with a new fetchRemoteMedia function. This new function incorporates an SSRF policy that blocks requests to private, reserved, loopback, and other sensitive IP ranges, thus mitigating the vulnerability. A subsequent commit, ddb7a8dd80b8d5dd04aafa44ce7a4354b568bb2d, further hardens the fix by expanding the hostname allowlist for media fetching.