Summary
A vulnerability in Inngest's serve() HTTP handler causes diagnostic responses for certain HTTP methods to include the entire process.env, exposing environment variables to unauthenticated remote clients.
When the serve() endpoint is reachable via PATCH, OPTIONS, or DELETE, attackers can trigger this diagnostic path and exfiltrate secrets, API keys, and credentials from the host process.
Affected context
This vulnerability affects applications using Inngest versions 3.22.0 through 3.53.1 where:
- The Inngest serve() endpoint is exposed over HTTP(S), and
- The endpoint is reachable via PATCH, OPTIONS, or DELETE requests.
These conditions are commonly met in setups such as:
- Next.js Pages Router when using middleware or catch-all routes that forward multiple HTTP methods to serve(), and
- Express applications using app.use(...) or similar constructs that do not restrict allowed HTTP methods.
Deployments that only expose GET, POST, and PUT handlers for serve(), or that use the connect worker method, are not affected by this specific leak pattern.
Exploit preconditions
- Attack surface: Public or internal HTTP endpoint implementing Inngest's serve() handler.
- Required access: Network access to the serve() endpoint; no authentication is needed.
- Trigger point: Sending a PATCH, OPTIONS, or DELETE request to the serve() endpoint causes the request to fall through to a generic diagnostic handler.
- Why exploitation is possible: The generic diagnostic handler, introduced in v3.22.0, includes process.env in its HTTP response body. This constitutes an unintended information exposure of sensitive configuration values available to the host process.
Why this happens
The root cause is an information exposure flaw where diagnostic responses unintentionally include sensitive runtime state.
Specifically, a change to the generic fallback handler for unsupported HTTP methods (PATCH, OPTIONS, DELETE) caused it to serialize and return the contents of process.env as part of the diagnostic payload.
This aligns with:
- CWE-200: Exposure of Sensitive Information to an Unauthorized Actor — sensitive environment variables are disclosed to unauthenticated clients.
- CWE-497: Exposure of System Data to an Unauthorized Control Sphere — detailed runtime configuration (environment variables, secrets, and credentials) is exposed outside the intended control boundary.
Conceptually, the bug stems from using internal debugging/diagnostic responses in production code without properly redacting or omitting secret-bearing fields.
Potential impact
- Exfiltration of API keys, database passwords, and other secrets stored in environment variables.
- Unauthorized access to third-party services (payment processors, email providers, storage backends, etc.).
- Lateral movement within the infrastructure using leaked credentials.
- Bypass of authentication/authorization controls in downstream systems by replaying service tokens.
- Facilitation of further exploitation such as data exfiltration, account takeover, or service impersonation.
General mitigation guidance
Mitigations focus on tightening HTTP surface area, sanitizing diagnostics, and hardening secret management:
- Restrict allowed HTTP methods on the serve() endpoint to only those required (GET, POST, PUT) at the framework or reverse-proxy layer.
- Avoid returning raw environment variables or other sensitive configuration values in any diagnostic or error responses.
- Centralize error and diagnostic handling to ensure secrets are redacted or omitted by default.
- Place Inngest (and similar worker) endpoints behind API gateways or reverse proxies that enforce strict method whitelisting and authentication where appropriate.
- Reduce secret blast radius by scoping environment variables to the minimum set required for the process, and use dedicated secret stores with fine-grained access controls.
- Apply least privilege in infrastructure design so that compromise of one service's environment does not grant broad access across systems.
How teams detect issues like this
Detection can rely on a mix of code inspection, automated analysis, and runtime monitoring:
- Static analysis & code review:
- Look for HTTP handlers or middleware that:
- Route multiple HTTP methods (including PATCH, OPTIONS, DELETE) to the same serve() handler.
- Include process.env, configuration dumps, or similar structures in HTTP responses or logs.
- Flag patterns where diagnostic or "debug" responses are wired into production routes.
- Configuration and policy enforcement:
- Enforce API gateway or reverse-proxy policies that explicitly whitelist allowed methods per endpoint.
- Use CI/CD checks to ensure certain handlers (e.g., serve()) are only bound to expected methods.
- Dynamic testing:
- Perform security testing that sends non-standard HTTP methods (PATCH, OPTIONS, DELETE) to public endpoints and inspects responses for environment variables or configuration dumps.
- Runtime monitoring:
- Use logging or WAF tooling to detect responses containing tokens, keys, or typical secret patterns, and alert on unexpected disclosures.

