Summary
A cross-tenant authorization flaw in Trigger.dev's deployment API allows a caller with a valid API key for one project to reference a deployment belonging to another project. The caller may link an attacker-controlled background worker to the victim deployment and change its state from BUILDING to DEPLOYING.
Affected context
The issue occurs in the deployment background-worker endpoint when a deployment is looked up using a friendly identifier without also constraining the lookup by environment or project ownership. Deployments using the affected service may be exposed when identifiers from different projects can be submitted through an authenticated API request.
Exploit preconditions
- Attack surface: Authenticated
POST /api/v1/deployments/:deploymentId/background-workersAPI requests - Required access: A valid API key for at least one project
- Required target knowledge: A deployment identifier associated with another project
- Trigger point: Creation or association of a deployment background worker
- Why exploitation is possible: The deployment query matches on
friendlyIdwithout enforcing an environment or project ownership predicate, allowing cross-tenant object access and modification
Why this happens
The underlying bug is an object-level authorization failure. The service retrieves a deployment using a caller-controlled friendly identifier but does not scope the database query to the caller's authorized environment or project. This behavior maps primarily to CWE-639: Authorization Bypass Through User-Controlled Key and is also consistent with CWE-862: Missing Authorization, because ownership checks are not enforced before the deployment is modified.
Potential impact
- An attacker may associate an attacker-controlled background worker with another project's deployment.
- A victim deployment could be moved from BUILDING to DEPLOYING without authorized approval.
- Project workflows may be disrupted or placed into an unexpected deployment state.
- Cross-tenant isolation could be weakened, potentially enabling further abuse of deployment functionality.
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the data-access boundary rather than relying on identifiers alone.
Common defensive patterns include:
- Scope deployment queries by authenticated project, environment, and tenant ownership.
- Perform explicit authorization checks before creating or associating background workers.
- Treat friendly identifiers as references, not proof of access rights.
- Use secure-by-default service methods that require an authorized tenant or environment context.
- Apply least-privilege API keys and separate permissions for deployment creation, association, and state transitions.
- Return indistinguishable not-found or unauthorized responses where appropriate to reduce cross-tenant identifier disclosure.
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis and code review rules that flag database lookups using user-controlled identifiers without tenant or ownership predicates.
- Review of service methods that modify resources after resolving only a public or friendly identifier.
- Tests that attempt cross-project access using valid credentials from a different tenant.
- API policy checks requiring project and environment context for deployment mutations.
- Audit-log monitoring for deployment state changes or worker associations initiated by principals outside the resource owner.
- Automated security review tools that detect missing object-level authorization checks.

