Skip to content

Server actions: serverActions.bodySizeLimit not enforced #1828

@james-elicx

Description

@james-elicx

This issue was created by an agent auditing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-06-08).

Problem

serverActions.bodySizeLimit is not enforced: server-action requests that exceed the configured limit are not rejected. Fails for both plaintext and multipart fetch actions, with and without node-runtime middleware.

Affected Test Suites

  • test/e2e/app-dir/actions/app-action-size-limit-invalid.test.ts (2 failures — plaintext, multipart; "should error for requests that exceed the size limit")
  • test/e2e/app-dir/actions/app-action-size-limit-invalid-node-middleware.test.ts (2 failures — same, with node-runtime middleware)

Estimated impact

~4 e2e failures across 2 suites.

Notes

Not covered by the existing server-action issues #1340 / #1480.

Recommendation

  1. Reproduce: set serverActions.bodySizeLimit and POST an oversized action body; assert the request errors instead of succeeding.
  2. Enforce the configured limit in the action-request handling path (both plaintext and multipart), including when a node-runtime middleware is present.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions