Summary
Kestra's unauthenticated worker endpoint may serialize complete live Task objects, exposing sensitive operational data such as commands, environment variables, headers, connection details, credentials, and execution identifiers.
The risk arises when the worker endpoint is reachable by an attacker while the primary Kestra API remains protected but does not protect this separate path.
Affected context
The issue occurs in Kestra deployments where the worker service exposes the GET /worker endpoint without authentication. Affected responses may include complete live Task objects, and therefore could contain secrets or internal execution metadata depending on task configuration and runtime state.
Exploit preconditions
- Attack surface: The Kestra worker HTTP endpoint serving GET /worker
- Required access: Network reachability to the worker endpoint; separate authentication to the main API may not provide protection
- Trigger point: Requesting the worker endpoint while a live Task object is available for serialization
- Why exploitation is possible: The endpoint does not adequately authenticate callers before returning task data that may contain sensitive fields
Why this happens
The underlying issue is an unauthenticated information-disclosure path combined with overly broad object serialization. The worker endpoint exposes a complete live Task object rather than a narrowly defined, sanitized response, allowing fields such as credentials, headers, commands, and environment variables to cross a trust boundary.
This maps primarily to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor and is also related to CWE-306: Missing Authentication for Critical Function, because the endpoint can return protected operational data without first establishing the caller's identity.
Potential impact
- Attackers may obtain plaintext credentials or connection details
- Exposed environment variables may reveal tokens, keys, or internal service information
- Commands and HTTP headers may disclose workflow logic and security-sensitive parameters
- Execution identifiers may support activity correlation or targeted follow-on attacks
- Leaked data could enable unauthorized access to connected systems
General mitigation guidance
Mitigation generally focuses on enforcing authentication and minimizing the data returned by worker endpoints.
Common defensive patterns include:
- Require strong authentication and authorization for all worker management and status endpoints
- Return purpose-built response objects containing only fields necessary for the endpoint's function
- Redact credentials, tokens, headers, environment variables, and other secrets before serialization
- Apply explicit data-classification rules to task and execution metadata
- Avoid placing plaintext secrets in task objects or environment variables where possible
- Isolate worker interfaces from untrusted networks and apply least-privilege service permissions
- Use secure-by-default logging and response policies that prevent accidental secret disclosure
How teams detect issues like this
Organizations can assess this issue through:
- Static and dynamic checks for HTTP routes that lack authentication or authorization middleware
- Code review of endpoints that serialize complete domain or runtime objects
- Tests confirming that unauthenticated requests cannot retrieve worker task data
- Response-content checks for credentials, tokens, environment variables, headers, and connection strings
- Network policy reviews verifying that worker endpoints are not broadly reachable
- Secret-scanning and data-loss-prevention rules applied to API responses and logs
- Automated code review tools that flag missing authentication and excessive serialization

