Skip to content

[agent] Add conservative JSON body size limit#1519

Open
starz0275 wants to merge 2 commits into
xevrion-v2:mainfrom
starz0275:fix/body-size-limit
Open

[agent] Add conservative JSON body size limit#1519
starz0275 wants to merge 2 commits into
xevrion-v2:mainfrom
starz0275:fix/body-size-limit

Conversation

@starz0275

Copy link
Copy Markdown

Summary

Configures a conservative JSON body size limit (100kb) for the Express app to prevent denial-of-service attacks via oversized payloads.

Changes

  • Added limit option to express.json() middleware with a default of 100kb
  • Made the limit configurable via JSON_BODY_LIMIT environment variable
  • Added inline documentation explaining the chosen value
  • Updated contributors/agents.json per CONTRIBUTING.md requirements

Why 100kb?

  • Default Express limit is 100kb, which is the recommended security practice
  • Typical JSON API payloads are well under 10kb
  • 100kb provides generous headroom while blocking oversized attack payloads
  • Environment variable override allows deployment-specific tuning

Closes #9

github-actions Bot added a commit that referenced this pull request Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add request body size limit

1 participant