Skip to content

fix(security): bound NewSession.lineId and SdpAnswer length - #296

Open
birme wants to merge 1 commit into
mainfrom
bug-fixer/290-session-schema-maxlength
Open

fix(security): bound NewSession.lineId and SdpAnswer length#296
birme wants to merge 1 commit into
mainfrom
bug-fixer/290-session-schema-maxlength

Conversation

@birme

@birme birme commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add maxLength: 200 to NewSession.lineId in src/models.ts (previously only minLength: 1), matching the existing WHIP/WHEP convention where lineId is already bounded to 200 chars. This prevents unbounded, attacker-controlled input from being persisted to the database via POST /session.
  • Add maxLength: 65536 to SdpAnswer.sdpAnswer in src/models.ts to cap the size of the SDP answer accepted by PATCH /session/:sessionId.
  • Add a focused regression test in src/api_validation.test.ts asserting a 201-char lineId is rejected with HTTP 400 by the POST /session schema.

Test plan

  • Tests pass (npm test — 244 passed, 14 suites)
  • TypeScript compiles (npm run typecheck — no errors)
  • Lint clean (npm run lint — 0 errors; only pre-existing any warnings)
  • Prettier clean (npx prettier --check on changed files)
  • New test rejects lineId exceeding 200 characters passes; over-long lineId now returns 400

Closes #290

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

…#290)

Add maxLength: 200 to NewSession.lineId (matching WHIP/WHEP convention)
and maxLength: 65536 to SdpAnswer.sdpAnswer to prevent unbounded input
being stored in the database. Adds a regression test asserting an
over-long lineId is rejected with 400.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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: NewSession.lineId missing maxLength constraint — unbounded input stored in DB

2 participants