Skip to content

fix(appraisal): reject oversized request bodies with 413 - #553

Merged
karagozemin merged 1 commit into
Sub-Rosa-Issue:mainfrom
Caneryy:feat/appraisal-body-limit
Oct 22, 2026
Merged

karagozemin merged 1 commit into
Sub-Rosa-Issue:mainfrom
Caneryy:feat/appraisal-body-limit

Conversation

@Caneryy

@Caneryy Caneryy commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • POST /appraise stops reading once the body passes 8192 bytes and returns a stable HTTP 413 before JSON parsing.
  • An over-limit Content-Length is rejected the same way, so the request never reaches a 402 payment quote.

Files

  • services/appraisal-api/src/body-limit.ts
  • services/appraisal-api/src/body-limit.test.ts
  • services/appraisal-api/src/server.ts
  • services/appraisal-api/README.md

Out of scope

  • Appraisal validation rules and payment settlement are unchanged.

Test plan

  • npx tsx --test src/body-limit.test.ts (413 for an oversized stream and for a declared Content-Length, 200 for a small JSON body)
  • CI on this PR

Closes #535

@karagozemin
karagozemin merged commit 24f4906 into Sub-Rosa-Issue:main Oct 22, 2026
1 of 4 checks passed
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.

security(high/easy): cap appraisal request body size

2 participants