aipotheosis-labs / aipotheosis-labs/aci
Security: SSRF in RestFunctionExecutor — no URL validation before HTTP request
- Ngôn ngữ chính
- Python
- Star
- 4.9k
- Fork
- 484
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
## 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with RestFunctionExecutor._execute() and compare its URL construction and httpx request path with frontend_qa_agent._validate_url(). Apply the same SSRF protections before requests, then verify that the API-key, OAuth2, and no-auth executors reject private IPs, loopback, and cloud metadata endpoints.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api, backend, security
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 58/100