Summary
Trigger.dev before 4.6.0 improperly authorizes access to the project environment variables endpoint. A holder of a restricted read:envvars key may receive the root TRIGGER_SECRET_KEY and plaintext secrets, which can enable task execution and creation of administrative public JWTs.
Trigger.dev before 4.6.0 improperly authorizes access to the project environment variables endpoint. A holder of a restricted read:envvars key may receive the root TRIGGER_SECRET_KEY and plaintext secrets, which can enable task execution and creation of administrative public JWTs.
Affected context
The vulnerability occurs in Trigger.dev deployments where the
GET /api/v1/projects/:projectRef/envvars endpoint exposes environment
values for staging, production, or preview environments. The issue is
relevant when a caller possesses a restricted environment-variable read
credential that should not grant access to root secrets or administrative
capabilities.
The vulnerability occurs in Trigger.dev deployments where the
GET /api/v1/projects/:projectRef/envvars endpoint exposes environment
values for staging, production, or preview environments. The issue is
relevant when a caller possesses a restricted environment-variable read
credential that should not grant access to root secrets or administrative
capabilities.
Exploit preconditions
- Attack surface: The authenticated project environment-variable API
- Required access: A valid restricted key with
read:envvarsaccess - Trigger point: A request to the project environment variables endpoint
- Why exploitation is possible: Authorization checks do not sufficiently
separate read access to environment variables from access to the root API
key and other sensitive secret values
- Attack surface: The authenticated project environment-variable API
- Required access: A valid restricted key with
read:envvarsaccess - Trigger point: A request to the project environment variables endpoint
- Why exploitation is possible: Authorization checks do not sufficiently
separate read access to environment variables from access to the root API
key and other sensitive secret values
Why this happens
The endpoint applies insufficient authorization boundaries to sensitive
environment data. A credential intended for restricted read access can
receive values with substantially greater privilege, including the
environment's root API key. This maps to CWE-269: Improper Privilege Management, because the system fails to enforce least privilege when
determining which secrets an authenticated caller may retrieve.
The endpoint applies insufficient authorization boundaries to sensitive
environment data. A credential intended for restricted read access can
receive values with substantially greater privilege, including the
environment's root API key. This maps to CWE-269: Improper Privilege Management, because the system fails to enforce least privilege when
determining which secrets an authenticated caller may retrieve.
Potential impact
- Attackers may disclose plaintext application secrets
- Attackers may obtain the root
TRIGGER_SECRET_KEY - Attackers could trigger protected tasks or workflows
- Attackers may mint administrative public JWTs
- Compromised credentials may enable unauthorized project or environment access
- Attackers may disclose plaintext application secrets
- Attackers may obtain the root
TRIGGER_SECRET_KEY - Attackers could trigger protected tasks or workflows
- Attackers may mint administrative public JWTs
- Compromised credentials may enable unauthorized project or environment access
General mitigation guidance
Mitigation generally focuses on enforcing least privilege throughout
environment-variable retrieval and secret management.
Defensive patterns include:
- Excluding root keys, signing secrets, and administrative credentials from
ordinary environment-variable responses
- Applying object-level and field-level authorization before returning each
secret
- Using separate credentials with narrowly scoped capabilities
- Returning metadata or redacted values instead of plaintext secrets where
full disclosure is unnecessary
- Protecting token-minting and task-triggering operations with independent
authorization checks
- Limiting the privileges and lifetime of service credentials
- Rotating potentially exposed secrets and reviewing dependent trust
relationships
Mitigation generally focuses on enforcing least privilege throughout
environment-variable retrieval and secret management.
Defensive patterns include:
- Excluding root keys, signing secrets, and administrative credentials from
ordinary environment-variable responses
- Applying object-level and field-level authorization before returning each
secret
- Using separate credentials with narrowly scoped capabilities
- Returning metadata or redacted values instead of plaintext secrets where
full disclosure is unnecessary
- Protecting token-minting and task-triggering operations with independent
authorization checks
- Limiting the privileges and lifetime of service credentials
- Rotating potentially exposed secrets and reviewing dependent trust
relationships
How teams detect issues like this
Detection can combine API authorization testing with code and policy review.
- Review endpoint handlers for missing project, environment, and field-level
authorization checks
- Use static analysis to identify responses that serialize complete secret
stores or privileged keys
- Add negative authorization tests confirming restricted keys cannot retrieve
root credentials or mint administrative tokens
- Monitor audit logs for environment-variable reads followed by task
triggering, token creation, or unusual project access
- Enforce API policies that classify root keys and signing secrets as
non-readable through standard configuration endpoints
- Automated security review tools may help flag privilege-boundary violations
Detection can combine API authorization testing with code and policy review.
- Review endpoint handlers for missing project, environment, and field-level
authorization checks
- Use static analysis to identify responses that serialize complete secret
stores or privileged keys
- Add negative authorization tests confirming restricted keys cannot retrieve
root credentials or mint administrative tokens
- Monitor audit logs for environment-variable reads followed by task
triggering, token creation, or unusual project access
- Enforce API policies that classify root keys and signing secrets as
non-readable through standard configuration endpoints
- Automated security review tools may help flag privilege-boundary violations

