Summary
An unauthenticated client can send a large chunked multipart/form-data request to POST /auth/sso, causing the webapp to buffer the request in memory before any rate limit is applied. The route is not covered by the streaming request body cap that Trigger.dev already applies to other body-consuming endpoints.
In a local component reproduction using the Node image and Remix/Express versions from current upstream, one 192 MiB request caused a 384 MiB webapp container to exit with code 137 and OOMKilled:true. This demonstrates termination of one memory-constrained webapp process or container.
Details
Affected revision and component
I confirmed the issue on commit c515c3f74656fe79e311acb1d32fe8f091f18a8d, which reports Trigger.dev version 4.8.4.
Affected component is the Remix webapp action for POST /auth/sso.
Root cause
The SSO action accepts both URL-encoded and multipart form bodies, then calls request.formData() before checking either its IP-based or email-based rate limit:
apps/webapp/app/routes/auth.sso.ts:26-54
const contentType = request.headers.get("content-type")?.toLowerCase() ?? "";
if (
!contentType.includes("application/x-www-form-urlencoded") &&
!contentType.includes("multipart/form-data")
) {
return new Response(null, { status: 415 });
}
const form = await request.formData();
// The IP and email rate limits begin later.
if (env.LOGIN_RATE_LIMITS_ENABLED) {
// ...
}
Trigger.dev already has middleware that counts request bytes while they arrive and returns 413 when a configured route exceeds its limit:
apps/webapp/app/services/ingressBodyCap.server.ts:9-88
That middleware runs before the Remix request handler:
apps/webapp/server.ts:287-295
However, its current policy includes only dashboard-agent and OTLP routes. /auth/sso is not included:
apps/webapp/app/entry.server.tsx:384-388
export const ingressBodyCap = createIngressBodyCap([
DASHBOARD_AGENT_INGRESS_CAP,
otlpIngressCap(env.OTLP_INGRESS_BODY_SIZE_LIMIT_MB * 1024 * 1024),
]);
There is no global Express body parser or request body ceiling before Remix. A Content-Length check alone would not close the path because HTTP/1.1 chunked requests can omit that header. The proof of concept below does so.
Expected behavior: An oversized unauthenticated request is rejected with 413 while it streams, before Remix buffers or parses the form.
Actual behavior: The request is buffered without an application-level limit. Under the tested memory limit, the process is killed before form parsing completes or the SSO rate limiter runs.
Evidence and limits
The reproduction uses the real createRemixRequest implementation from @remix-run/express@2.17.5, followed by the same request.formData() call used by the affected route. It runs in the exact Node image digest pinned by current upstream and uses the same Remix and Express versions as apps/webapp/package.json.
This is an isolated HTTP component proof and it establishes the parsing behavior + termination of one memory-constrained process or container. It doesn't confirm Trigger.dev Cloud's container memory limit, replica count, restart behavior, autoscaling behavior, request timeouts or AWS WAF configuration. I sent no oversized request to Trigger.dev Cloud and accessed no customer data.
Suggested remediation
Add an /auth/sso policy to the existing ingressBodyCap list so the request is counted and refused before Remix parses it. A small route-specific ceiling should be sufficient because the form contains short values such as email, redirectTo, and flow.
If the SSO form never requires file uploads, rejecting multipart/form-data and accepting only application/x-www-form-urlencoded would reduce the exposed parser surface. I would still keep a streaming byte cap because chunked URL-encoded bodies can also omit Content-Length.
A regression test should send an over-limit chunked request without Content-Length, confirm a 413 response, and confirm the Remix action is never entered.
Summary
An unauthenticated client can send a large chunked
multipart/form-datarequest toPOST /auth/sso, causing the webapp to buffer the request in memory before any rate limit is applied. The route is not covered by the streaming request body cap that Trigger.dev already applies to other body-consuming endpoints.In a local component reproduction using the Node image and Remix/Express versions from current upstream, one 192 MiB request caused a 384 MiB webapp container to exit with code 137 and
OOMKilled:true. This demonstrates termination of one memory-constrained webapp process or container.Details
Affected revision and component
I confirmed the issue on commit
c515c3f74656fe79e311acb1d32fe8f091f18a8d, which reports Trigger.dev version 4.8.4.Affected component is the Remix webapp action for
POST /auth/sso.Root cause
The SSO action accepts both URL-encoded and multipart form bodies, then calls
request.formData()before checking either its IP-based or email-based rate limit:apps/webapp/app/routes/auth.sso.ts:26-54Trigger.dev already has middleware that counts request bytes while they arrive and returns 413 when a configured route exceeds its limit:
apps/webapp/app/services/ingressBodyCap.server.ts:9-88That middleware runs before the Remix request handler:
apps/webapp/server.ts:287-295However, its current policy includes only dashboard-agent and OTLP routes.
/auth/ssois not included:apps/webapp/app/entry.server.tsx:384-388There is no global Express body parser or request body ceiling before Remix. A
Content-Lengthcheck alone would not close the path because HTTP/1.1 chunked requests can omit that header. The proof of concept below does so.Expected behavior: An oversized unauthenticated request is rejected with 413 while it streams, before Remix buffers or parses the form.
Actual behavior: The request is buffered without an application-level limit. Under the tested memory limit, the process is killed before form parsing completes or the SSO rate limiter runs.
Evidence and limits
The reproduction uses the real
createRemixRequestimplementation from@remix-run/express@2.17.5, followed by the samerequest.formData()call used by the affected route. It runs in the exact Node image digest pinned by current upstream and uses the same Remix and Express versions asapps/webapp/package.json.This is an isolated HTTP component proof and it establishes the parsing behavior + termination of one memory-constrained process or container. It doesn't confirm Trigger.dev Cloud's container memory limit, replica count, restart behavior, autoscaling behavior, request timeouts or AWS WAF configuration. I sent no oversized request to Trigger.dev Cloud and accessed no customer data.
Suggested remediation
Add an
/auth/ssopolicy to the existingingressBodyCaplist so the request is counted and refused before Remix parses it. A small route-specific ceiling should be sufficient because the form contains short values such asemail,redirectTo, andflow.If the SSO form never requires file uploads, rejecting
multipart/form-dataand accepting onlyapplication/x-www-form-urlencodedwould reduce the exposed parser surface. I would still keep a streaming byte cap because chunked URL-encoded bodies can also omitContent-Length.A regression test should send an over-limit chunked request without
Content-Length, confirm a 413 response, and confirm the Remix action is never entered.