Skip to content

fix: enforce max body length when max redirects is 0#10753

Merged
jasonsaayman merged 1 commit intov1.xfrom
fix/ghsa-5c9x-8gcm-mpgx
Apr 18, 2026
Merged

fix: enforce max body length when max redirects is 0#10753
jasonsaayman merged 1 commit intov1.xfrom
fix/ghsa-5c9x-8gcm-mpgx

Conversation

@jasonsaayman
Copy link
Copy Markdown
Member

@jasonsaayman jasonsaayman commented Apr 18, 2026

Summary by cubic

Enforce maxBodyLength for streamed uploads when using the native Node http/https transport (maxRedirects: 0). Prevents oversized bodies from being sent and aligns behavior with follow-redirects.

Description

  • Summary of changes: Add a transform pipeline to track bytes and throw when exceeding maxBodyLength only when maxRedirects is 0; pipe uploadStream to the request and destroy on error.
  • Reasoning: Previously the limit wasn’t enforced on the native path, allowing large uploads (GHSA-5c9x-8gcm-mpgx). This brings parity with follow-redirects.
  • Additional context: No change for redirected requests; only affects streamed uploads on Node with maxRedirects: 0.

Docs

  • Note in the Node adapter docs that maxBodyLength is enforced for streamed uploads even when maxRedirects is 0.
  • Document the error message: “Request body larger than maxBodyLength limit”.

Testing

  • Added two unit tests:
    • Rejects streamed upload exceeding maxBodyLength with maxRedirects: 0.
    • Allows streamed upload under the limit with maxRedirects: 0.

Written for commit bf0a349. Summary will update on new commits.

@jasonsaayman jasonsaayman self-assigned this Apr 18, 2026
@jasonsaayman jasonsaayman added priority::medium A medium priority commit::fix The PR is related to a bugfix type::security The PR is a secuirty related changed normally from a CVE labels Apr 18, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::fix The PR is related to a bugfix priority::medium A medium priority type::security The PR is a secuirty related changed normally from a CVE

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant