The vulnerability is a Server-Side Request Forgery (SSRF) present in the openclaw npm package. The analysis of the patch commit 8deb9522f3d2680820588b190adb4a2a52f3670b reveals that multiple functions across different files were making insecure fetch calls. These functions are related to two main features: Ollama model discovery and Marketplace plugin downloads.
In the Ollama integration files (extensions/ollama/src/provider-models.ts and extensions/ollama/src/setup.ts), functions like queryOllamaContextWindow, fetchOllamaModels, checkOllamaCloudAuth, and pullOllamaModelCore constructed request URLs from a base URL that could be configured by the operator. The code did not properly sanitize or restrict the hostnames for these outgoing requests, allowing a malicious operator to point the application to internal or arbitrary external URLs.
Similarly, in the marketplace functionality (src/plugins/marketplace.ts), the downloadUrlToTempFile function accepted a URL to download a plugin. This URL was not validated, creating an SSRF vulnerability where an attacker could provide a URL to an internal resource, causing the server to access it.
The patch addresses these issues by replacing all the vulnerable fetch calls with a new fetchWithSsrFGuard utility. This wrapper function enforces SSRF policies. For the Ollama-related functions, a specific policy is created using buildOllamaBaseUrlSsrFPolicy which pins the allowed hostname to the one configured for the Ollama service. For the marketplace download, fetchWithSsrFGuard is called with a specific audit context, implying a default or pre-configured policy is applied to prevent requests to unintended destinations.