aipotheosis-labs / aipotheosis-labs/aci
Security: SSRF in RestFunctionExecutor — no URL validation before HTTP request
- Dominant language
- Python
- Stars
- 4.9k
- Forks
- 484
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
`RestFunctionExecutor._execute()` constructs a URL from `protocol_data.server_url` + `protocol_data.path` and makes an HTTP request via `httpx` without any URL validation. This allows function executions to reach internal services, cloud metadata endpoints, and localhost services.
The `frontend_qa_agent._validate_url()` already implements SSRF protections (blocking private IPs, loopback, and cloud metadata endpoints), but this validation is not applied to the function executor path.
## Impact
- Cloud metadata exfiltration: `server_url = "http://169.254.169.254/"` → AWS/GCP/Azure IAM credentials leaked
- Internal service scanning: `server_url = "http://10.0.0.{n}/"` → port scan internal network
- Local service access: `server_url = "http://localhost:{port}/"` → access DB, admin panels
All three executors (API key, OAuth2, no-auth) inherit from `RestFunctionExecutor` and are affected.
## Suggested Fix
Add `_validate_url()` to `RestFunctionExecutor` mirroring the existing validation in `frontend_qa_agent._validate_url()`. I have a working patch and can open a PR if the maintainers would like one.
Per the repo's SECURITY.md, I'm reporting this as an issue since private advisory creation requires admin access. Happy to transition to a private advisory if preferred.
Contributor guide
Assessment
This issue has not been assessed yet.