Summary
Trigger.dev before 4.6.2 contains an authorization flaw in session input initialization that can expose environment-wide S2 stream credentials to holders of public tokens with session write access. Those credentials may allow unauthorized creation, appending, or trimming of other session and run streams, enabling forged output or deletion of records.
Trigger.dev before 4.6.2 contains an authorization flaw in session input initialization that can expose environment-wide S2 stream credentials to holders of public tokens with session write access. Those credentials may allow unauthorized creation, appending, or trimming of other session and run streams, enabling forged output or deletion of records.
Affected context
The issue occurs in Trigger.dev deployments where public-token holders are granted session write access and session input initialization returns credentials with broader, environment-wide scope than intended. The exposed credentials can then be used against the storage API to interact with streams belonging to other sessions or runs.
The issue occurs in Trigger.dev deployments where public-token holders are granted session write access and session input initialization returns credentials with broader, environment-wide scope than intended. The exposed credentials can then be used against the storage API to interact with streams belonging to other sessions or runs.
Exploit preconditions
- Attack surface: Session input initialization and the S2 storage API
- Required access: A valid public token with session write permissions
- Trigger point: Initialization of session input data
- Why exploitation is possible: The authorization boundary permits access to credentials whose scope exceeds the requesting session, allowing subsequent stream operations without adequate ownership checks
- Attack surface: Session input initialization and the S2 storage API
- Required access: A valid public token with session write permissions
- Trigger point: Initialization of session input data
- Why exploitation is possible: The authorization boundary permits access to credentials whose scope exceeds the requesting session, allowing subsequent stream operations without adequate ownership checks
Why this happens
The vulnerability results from missing authorization enforcement when session-scoped access is established. Credentials with environment-wide stream privileges are exposed to a caller whose permissions are limited to writing a session, and downstream storage operations do not sufficiently verify session or run ownership.
This maps to CWE-862: Missing Authorization, where an application fails to enforce an access-control decision before permitting a protected operation.
The vulnerability results from missing authorization enforcement when session-scoped access is established. Credentials with environment-wide stream privileges are exposed to a caller whose permissions are limited to writing a session, and downstream storage operations do not sufficiently verify session or run ownership.
This maps to CWE-862: Missing Authorization, where an application fails to enforce an access-control decision before permitting a protected operation.
Potential impact
- Attackers may append forged data to other session or run streams
- Attackers could create unauthorized streams
- Existing stream records may be permanently trimmed or deleted
- Application output and execution history may be manipulated
- Integrity and availability of stored session data may be reduced
- Attackers may append forged data to other session or run streams
- Attackers could create unauthorized streams
- Existing stream records may be permanently trimmed or deleted
- Application output and execution history may be manipulated
- Integrity and availability of stored session data may be reduced
General mitigation guidance
Mitigation generally focuses on enforcing authorization at every credential issuance and storage operation.
Common defensive patterns include:
- Issue narrowly scoped, session-bound credentials rather than environment-wide credentials
- Validate session and run ownership for every create, append, and trim request
- Treat public tokens as untrusted and limit them to the minimum required capability
- Apply least privilege and short lifetimes to storage credentials
- Separate administrative, service, and end-user storage permissions
- Log and rate-limit sensitive stream operations, with policy controls for destructive actions
Mitigation generally focuses on enforcing authorization at every credential issuance and storage operation.
Common defensive patterns include:
- Issue narrowly scoped, session-bound credentials rather than environment-wide credentials
- Validate session and run ownership for every create, append, and trim request
- Treat public tokens as untrusted and limit them to the minimum required capability
- Apply least privilege and short lifetimes to storage credentials
- Separate administrative, service, and end-user storage permissions
- Log and rate-limit sensitive stream operations, with policy controls for destructive actions
How teams detect issues like this
Organizations can assess this weakness through:
- Static and architectural analysis of token issuance and authorization middleware
- Code review for environment-wide credentials returned from session-scoped endpoints
- Tests that attempt cross-session and cross-run stream access using public tokens
- API policy checks requiring ownership validation for create, append, and trim operations
- Monitoring for unusual cross-session stream activity, unexpected trimming, or high-volume writes
Automated security review tools may help identify missing authorization checks and excessive credential scope.
Organizations can assess this weakness through:
- Static and architectural analysis of token issuance and authorization middleware
- Code review for environment-wide credentials returned from session-scoped endpoints
- Tests that attempt cross-session and cross-run stream access using public tokens
- API policy checks requiring ownership validation for create, append, and trim operations
- Monitoring for unusual cross-session stream activity, unexpected trimming, or high-volume writes
Automated security review tools may help identify missing authorization checks and excessive credential scope.

