Summary
A server-side request forgery (SSRF) vulnerability in poco-claw's task execution API allows an attacker to control outbound HTTP requests via the callback_url parameter.
When an attacker can supply or influence this URL, the server may initiate requests to internal or otherwise protected endpoints, exposing services and data that are not directly accessible from the internet.
Affected context
This vulnerability occurs within the task execution endpoint of poco-claw, specifically in the run_task function that accepts a callback_url parameter.
It is relevant in deployments where the application can make outbound HTTP requests and where callback endpoints are not strictly validated or constrained.
Environments with reachable internal networks, metadata services, or administrative APIs behind firewalls are more exposed, as the application server effectively bridges the attacker to those internal targets.
Exploit preconditions
- Attack surface: Public or externally reachable API endpoint that accepts a
callback_urlparameter for task callbacks. - Required access: Ability to invoke the affected task API and control or influence the
callback_urlvalue (typically via standard HTTP requests). - Trigger point: Submission or scheduling of a task that causes the server to perform an outbound HTTP request to the supplied
callback_url. - Why exploitation is possible: The server uses attacker-provided URLs for outbound requests without robust validation, allowing the server to be used as a proxy to reach internal or restricted network resources (CWE-918).
Why this happens
The underlying issue is the direct use of user-supplied URLs in server-side HTTP requests without adequate validation or restriction.
The run_task logic likely assumes the callback_url is trustworthy and does not enforce constraints such as allowed domains, IP ranges, or protocols.
This pattern maps to CWE-918: Server-Side Request Forgery (SSRF), where the server is tricked into making network requests on behalf of an attacker, leveraging the server's network position and privileges.
Potential impact
- Unauthorized access to internal HTTP-based services that are not exposed publicly
- Retrieval of sensitive data from cloud metadata services or internal APIs
- Interaction with administrative or management endpoints reachable only from the server's network
- Use of the application server as a pivot point for further network reconnaissance
- Potential abuse of trust relationships and misconfigured internal services leading to broader compromise
General mitigation guidance
Effective mitigation focuses on strictly controlling where the server can make outbound requests and reducing trust in user-supplied URLs.
Recommended patterns include:
- Enforcing allowlists of permitted callback domains or service endpoints and rejecting any other destinations
- Performing rigorous validation of URLs, including scheme, host, port, and path, avoiding direct requests to IP literals, localhost, private IP ranges, or link-local addresses
- Implementing network-level egress controls so application servers cannot freely reach arbitrary internal services or metadata endpoints
- Using indirect callback mechanisms (e.g., identifiers or message queues) instead of direct URLs provided by clients
- Running services with least-privilege network access, limiting what internal resources they can contact
How teams detect issues like this
Detection typically involves a combination of code analysis and operational monitoring:
- Static analysis rules that flag use of user-controlled URL parameters in outbound HTTP requests
- Manual code review patterns focusing on callback, webhook, and URL handling logic, verifying that allowlists and validation are present
- Centralized policies requiring approval for new outbound network dependencies and enforcing SSRF-safe URL handling
- Runtime monitoring and logging of outbound requests to unusual destinations (e.g., internal IP ranges, metadata service endpoints) and alerting on anomalies
- Use of automated security testing tools and dynamic scanners configured to probe callback or webhook parameters for SSRF behaviors

