Forcing 413 Content Too Large
Per RFC 9110 §15.5.14, a server returns 413 when the request content exceeds size limits.
Mechanism: Per RFC 9110 §15.5.14, a server returns 413 when the request content exceeds size limits. If the application enforces size limits after resolving the resource (per-resource limits), existing resources return 413 while non-existing ones return 404.
Isolated Variable: Only the payload size changes. Headers and structure remain valid.
Oracle Signal: 413 (exists, per-resource limit hit) vs 404 (does not exist).
POST — Existing Parent Resource (File Upload)
POST /api/documents/doc-abc/attachments HTTP/1.1
Host: target.com
Content-Type: multipart/form-data; boundary=----Boundary
Content-Length: 52428800
------Boundary
Content-Disposition: form-data; name="file"; filename="large.bin"
Content-Type: application/octet-stream
<50 MB of binary data>
------Boundary--
HTTP/1.1 413 Content Too Largevs. 404 when document doc-abc does not exist.
💡
Content-Lengthspoofing shortcut: Declare a massiveContent-Lengthwhile sending a small body. Many servers checkContent-Lengthagainst their limit before reading the full body, returning413immediately.
💡 Distinguishing global vs per-resource limits: Compare an oversized request to a known-valid resource, a known-invalid resource, and a non-resource path. If all return
413, the limit is global (no oracle). If only the valid resource returns413, the oracle is confirmed.
Mitigation: Enforce body size limits at the reverse proxy or global middleware layer before routing to resource-specific handlers.