The vulnerability is a Server-Side Request Forgery (SSRF) in the Zalo plugin of OpenClaw, specifically within the photo sending functionality. The root cause is the lack of validation on the photo URL provided when sending a photo. The primary vulnerable function is sendPhoto in extensions/zalo/src/api.ts. Before the patch, this function would take a URL and pass it to callZaloApi without checking if the URL pointed to an internal or restricted resource. An attacker could craft a request with a malicious photo URL to make the server send requests to internal services.
The patch addresses this by adding several layers of validation within the sendPhoto function:
- It ensures the provided string is a valid URL.
- It checks that the URL protocol is either
http or https.
- Most importantly, it uses
resolvePinnedHostnameWithPolicy to check the URL's hostname against a defined SSRF policy, preventing requests to private or internal IP addresses.
The function sendPhotoZalo in extensions/zalo/src/send.ts is also identified as a vulnerable function because it is an entry point that directly calls the vulnerable sendPhoto function, passing user-controllable data to it. Any runtime trace of an exploit would likely show sendPhotoZalo calling sendPhoto.