API hardening — SSRF prevention & payload limits
Security hardening
The production API now validates callback URLs and enforces request size limits to protect against server-side request forgery (SSRF) and resource exhaustion attacks.
What’s new
- Callback URL validation — the API rejects callback URLs targeting private networks (
127.x,10.x,172.16-31.x,192.168.x),localhost, IPv6 loopback, and non-HTTP schemes (file://,ftp://, etc.). This prevents SSRF attacks where a malicious callback URL could probe internal services. - 10MB request body limit — all API endpoints now reject requests with a
Content-Lengthexceeding 10MB, preventing memory exhaustion from oversized payloads. - 1MB job payload limit — the
payloadfield onPOST /v1/jobs/enqueueis capped at 1MB. If your job data exceeds this, consider storing the data externally and passing a reference (e.g., an S3 URL) as the payload instead.
What’s unchanged
- The local dev server (
queuebase dev) is unaffected —localhostcallbacks work as expected in development. - Existing jobs and projects with valid public callback URLs are unaffected.