Repository navigation
Conversation
Contributor
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Security fix in @remotion/lambda-client that stops leaking the serialized Lambda payload into the client-side oversize error message.
- Remove payload echo from oversize error (
packages/lambda-client/src/call-lambda-async.ts:25) — thePayload: ${stringifiedPayload}suffix is dropped, leavingPayload is too big: ${byteLength} bytes…. The guard, threshold (> 256 * 1024), error type, and measured byte count are unchanged, so behavior is identical except the message no longer containswebhook.secret,licenseKey, orcustomCredentials.secretAccessKey.
I grepped the monorepo for consumers of the message text (Payload is too big, Maximum size is, Payload:) and found no tests, docs, or parsers that depend on the removed suffix, so nothing downstream breaks.
deepseek-v4.1-flash | 𝕏
@remotion/lambda-client: Do not dump payload into oversize error
DeryFerd
force-pushed
the
fix/lambda-client-error-payload-dump
branch
from
October 9, 2026 17:37
ad2a9a7 to
f2e22d8
Compare
DeryFerd
force-pushed
the
fix/lambda-client-error-payload-dump
branch
from
October 11, 2026 09:39
f2e22d8 to
55a147a
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
callFunctionAsyncImplementation()refuses payloads over 256 KB before anything is sent to AWS, throwing a local error that reports the measured size. Until now, the message also appended the entire serialized payload after the byte count. This PR removes that echo and leaves the rest of the message untouched.The payload being checked is not just data. It carries
webhook.secret,licenseKey, andcustomCredentials.secretAccessKeyfor custom S3 output buckets, on top of whatever the user stored ininputProps, which can be anything at all. The error text ends with "please report this to the Remotion team", so when someone actually hits this guard the natural next step is to copy the message into a GitHub issue, and that copy would contain their webhook signing secret and AWS credentials verbatim. Error trackers captureError.messagethe same way. The throw happens beforeInvokeCommand, so nothing of this reaches CloudWatch; the exposure is the path from the user's console or CI log into a public bug report.This is the follow-up that was offered in #12114 when the measurement was switched to
Buffer.byteLength. That change kept the dump in place to stay a one-line diff and noted that redacting fields likewebhook.secretorlicenseKeycould be done separately. The two changes pair naturally: #12114 made the number in the message honest, and this one makes the message safe to paste. The guard condition, the error type, and the printed byte count are all unchanged; a payload that threw before still throws, with the same wording minus the payload itself.I removed the whole echo rather than redacting known fields.
inputPropsis user-defined, so any field-by-field scheme is an allowlist that silently misses whatever the next user puts there. Dropping the echo is complete by construction, and what remains (size, limit, ask to report) is what the caller needs anyway. The caller still has the payload in scope if they want to inspect it themselves.Validation
I verified this with a throwaway test in the style of the existing
call-lambda-sync.test.ts(mocked../aws-clients, dynamic import of the implementation) and removed it again before committing to keep the PR source-only; happy to add a permanent regression test if you would like one.webhook.secretand alicenseKey, serializing to 600,109 UTF-8 bytes, comfortably over the limit. Before the change, the assertion that the message must not contain the secret failed, which is the leak: the thrown message ended with the full payload, secret included. After the change, the message is exactlyPayload is too big: 600109 bytes. Maximum size is 256 KB. This should not happen, please report this to the Remotion team., and the mocked Lambda client is never called.bunx eslint srcinpackages/lambda-client: 0 errors. The 2 warnings are pre-existing in untouched files (aws-clients.tsunused disable directive,constants.tsTODO comment) and are identical before and after.bunx tsgo -d: 121 errors with the change and 121 without it, compared by stashing the edit. The only entry incall-lambda-async.tsis the pre-existingTS2307: Cannot find module '@remotion/serverless-client'from unbuilt workspace types in this checkout, present on the baseline too.bun test srcinpackages/lambda-client: 9 pass / 7 fail / 7 errors before and after, same set. The failures are missing-module errors for workspace packages that are not built in this environment, unrelated to this file.docs/lambda/quotes this client-side error text, so there is nothing to update.Tradeoffs
What you lose is seeing which field pushed the payload over 256 KB from the error message alone. In practice the person hitting this guard constructed the payload a few lines above the call, and the byte count already says how far over the limit it is; anyone debugging further can log the payload themselves, deliberately. I considered keeping a truncated dump (first few hundred characters, say), but truncation still leaks whatever field happens to sit at the front, so it buys little. If you would rather keep some form of payload preview or take the redaction route instead, that is easy to swap in on top of this.