Skip to content

fix: reject unsafe GraphQL body limits - #1776

Open
kang-heewon wants to merge 1 commit into
trunkfrom
fix/1703-graphql-body-limit
Open

fix: reject unsafe GraphQL body limits#1776
kang-heewon wants to merge 1 commit into
trunkfrom
fix/1703-graphql-body-limit

Conversation

@kang-heewon

Copy link
Copy Markdown
Member

Outcome

GraphQL server initialization now rejects maxBodySizeBytes values that are not finite positive safe integers, including runtime null input, with the stable transports-graphql/body-limit-invalid-configuration Problem before a listener is opened.

Validated limits are fixed at initialization and enforce an inclusive byte boundary for both Content-Length and chunked request bodies. The public Problem export, recovery registry, documentation, API snapshot, and release changesets are synchronized.

Fixes #1703

Verification

  • pnpm --filter @croco/transports-graphql test — 36 passed
  • package lint, typecheck, and build — passed
  • pnpm problem-registry:check — 582/582 codes matched
  • pnpm public-api:check — 115/115 package snapshots matched
  • pnpm static-misuse:check — all rules passed
  • pnpm changeset-required:check -- --base origin/trunk --head HEAD — affected packages covered
  • pnpm check — 24/25 repository gates passed; 1 not applicable
  • pre-push workspace gates — 234/234 test tasks and 233/233 typecheck tasks passed
  • git diff --check — passed

Review gates

  • Correctness and regression — PASS. Invalid numeric and runtime null configurations fail during initialization; valid multibyte UTF-8 bodies prove exact N-byte acceptance and N+1 rejection through both declared-length and chunked paths.
  • API, security, compatibility, and release — PASS. The typed Problem is exported and registered with operator-only recovery metadata; API snapshots and patch changesets cover transports-graphql and problems-core; dependencies, lockfile, secrets, and valid configuration behavior are unchanged.
  • Maintainability and minimality — PASS. The runtime change is limited to one initialization validation boundary and one stored validated value; remaining changes are tests, documentation, required generated artifacts, and the source-line update for the existing reviewed logging allowlist.
  • Independent adversarial review — PASS after fixes. Review identified runtime null defaulting and ASCII-only boundary coverage; both were corrected and the final re-review found no remaining actionable issue.

Residual risk

None identified within the issue scope.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kang-heewon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 02d0d813-66e7-48e5-afdb-4633fb7af5e1

📥 Commits

Reviewing files that changed from the base of the PR and between 6795b4d and 10e6d96.

⛔ Files ignored due to path filters (1)
  • packages/problems-core/src/generated/problem-code-registry.ts is excluded by !**/generated/**
📒 Files selected for processing (11)
  • .changeset/safe-graphql-body-limit-configuration.md
  • docs/problem-code-registry.json
  • packages/docs/src/content/docs/en/reference/problem-recovery-cookbook.md
  • packages/transports-graphql/README.md
  • packages/transports-graphql/src/index.ts
  • packages/transports-graphql/src/libs/GraphQLServer.ts
  • packages/transports-graphql/src/libs/problems/GraphQLTransportProblems.ts
  • packages/transports-graphql/src/tests/GraphQLServer.spec.ts
  • public-api-surface.snapshot.json
  • scripts/problem-registry.mts
  • scripts/static-misuse-empty-catch-allowlist.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 43.6μs 30.0ms 8.2μs +432.9% -
CrocoApp lambdaHandler (10 controllers) 2.0ms 50.0ms 258.4μs +686.8% -
Lambda cold-start simulation 1.8ms 80.0ms 418.1μs +322.5% -
Lambda cold-start with headers 1.6ms 80.0ms 369.7μs +332.7% -
Lambda cold-start with binary body 1.5ms 80.0ms 339.1μs +348.3% -
Lambda cold-start with query params 1.5ms 80.0ms 301.3μs +414.3% -
Lambda cold-start with authorizer context 1.5ms 80.0ms 299.8μs +400.3% -
Lambda cold-start realistic scenario 1.5ms 80.0ms 299.2μs +402.2% -
EventBusConfig.start (10 handlers) 1.6μs 10.0ms 1.4μs +14.7% -
EventPublisher.publishNow single event 1.8μs 2.0ms 1.7μs +9.5% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs +0.0% -
Container.get singleton (cold) 91.5μs 5.0ms 70.3μs +30.3% -
Container.register × 50 components 3.4ms 10.0ms 3.2ms +5.5% -
Container.validate (50 components) 3.8ms 20.0ms 3.4ms +13.2% -
Container.get singleton (warm) 1.7μs 500.0μs 1.6μs +3.1% -
TelemetryRuntime.init (lambda preset) 2.2μs 200.0ms 1.1ms -99.8% -
lambdaPreset config creation 1.5μs 2.0ms 1.4μs +2.2% -

Updated: 2026-08-08T07:58:02.455Z · Commit: 44236f3

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.

[transports-graphql] Validate maxBodySizeBytes as a finite positive transport limit

1 participant