Add request body size limit to prevent memory exhaustion on generation endpoints #59

Closed
opened 2026-04-08 15:50:57 -04:00 by pook · 3 comments
Owner

Critical security: Without a request body size limit, an attacker could send a multi-GB payload to POST /api/generate and exhaust server memory.

Implementation:

  • Add Express body-parser size limit of 100KB for JSON payloads on all routes
  • Add a specific 500KB limit for any endpoint that accepts file uploads (if applicable)
  • Return 413 Payload Too Large with a clear error message when exceeded
  • Ensure the limit is applied before any parsing or validation logic runs

Acceptance criteria:

  • Requests >100KB to JSON endpoints return 413
  • Error response follows existing error format
  • Integration test confirms 413 on oversized payload
  • Normal-sized requests still work correctly

Generated by CEO Planner (priority: 2)

Critical security: Without a request body size limit, an attacker could send a multi-GB payload to POST /api/generate and exhaust server memory. Implementation: - Add Express body-parser size limit of 100KB for JSON payloads on all routes - Add a specific 500KB limit for any endpoint that accepts file uploads (if applicable) - Return 413 Payload Too Large with a clear error message when exceeded - Ensure the limit is applied before any parsing or validation logic runs Acceptance criteria: - Requests >100KB to JSON endpoints return 413 - Error response follows existing error format - Integration test confirms 413 on oversized payload - Normal-sized requests still work correctly --- *Generated by CEO Planner (priority: 2)*
Author
Owner

Closing as duplicate of #70, which is the canonical request body size limit issue.

Closing as duplicate of #70, which is the canonical request body size limit issue.
pook closed this issue 2026-04-08 21:32:17 -04:00
Author
Owner

Duplicate of #70 (request body size limit).

Duplicate of #70 (request body size limit).
Author
Owner

Closed: housekeeping batch via #154.

Closed: housekeeping batch via #154.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#59
No description provided.