Skip to content

No guard against Lambda's ~6 MB synchronous payload limit #36

Open

Description

@danmoz

Medium severity.

Default max_body_size is 4 MiB (req_resp.go:22); a binary body base64-inflates to ~5.6 MB, and headers + envelope can push the marshaled payload past 6 MB. Larger user-configured values make it certain. AWS then rejects the invoke and the client gets a misleading 502.

Activity

  1. self-assigned this
    on Sep 5, 2026
  2. danmoz commented on Sep 5, 2026

    @danmoz
    OwnerAuthor

    I deliberately set the default to 4MB, because as you point out:

    a binary body base64-inflates to ~5.6 MB

    ...which is just below the 6MB limit with a little overhead.

    That said, we shouldn't be sending a 6MB+ request to Lambda if we know its going to fail; we could fail fast. An HTTP 413 Content Too Large seems appropriate.

    /oc Please create a PR.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions