The security vulnerability is a Server-Side Request Forgery (SSRF) found in the OpenClaw QQBot extension. The root cause lies in the uploadC2CMedia and uploadGroupMedia functions located in extensions/qqbot/src/api.ts. These functions are designed to handle direct media uploads from a URL. The vulnerability existed because these functions would accept a URL from a user and use it to fetch content without validating that the URL pointed to a safe, public location. An attacker could exploit this by providing a URL that resolves to an internal or private IP address, tricking the server into making requests to internal services it should not have access to.
The patch, found in commit 49db424c8001f2f419aad85f434894d8d85c1a09, rectifies this issue by introducing a validation step. A new helper function, assertDirectUploadUrlAllowed, was added. This function is now called by both uploadC2CMedia and uploadGroupMedia before the URL is used. The assertDirectUploadUrlAllowed function performs two critical checks: it ensures the URL uses the https: protocol and then uses resolvePinnedHostnameWithPolicy to verify that the hostname does not resolve to a blocked, private, or internal IP address. By adding this explicit validation, the patch prevents the SSRF vulnerability.