Summary
goose executes commands defined in recipe stdio extensions and retry.checks without including those fields in its security inspection. An attacker who distributes a malicious recipe may cause shell commands to run with the privileges of the user executing goose.
Affected context
The vulnerability occurs when goose processes recipes containing command-capable stdio extensions or retry.checks. It becomes risky when recipes originate from untrusted sources or can be distributed to users, and when the executing account has access to sensitive files, credentials, or other local resources.
Exploit preconditions
- Attack surface: Recipe processing within goose
- Required access: Ability to provide, publish, or induce use of a malicious recipe
- Trigger point: Execution of a recipe containing command-capable
stdioor retry configuration - Why exploitation is possible: The recipe security scan does not inspect these configuration areas before commands are executed
Why this happens
The underlying flaw is incomplete security inspection of a structured recipe format. Command-capable extensions and retry checks are accepted and executed without applying the same trust validation used for other recipe content, allowing attacker-controlled configuration to cross into a command execution sink. This behavior maps to CWE-94: Improper Control of Generation of Code, because untrusted recipe data can influence executable command behavior.
Potential impact
- An attacker may execute arbitrary shell commands as the goose user
- Local files, environment variables, or credentials could be exposed
- The host or development environment could be modified or compromised
- Malicious recipes could enable persistence, data tampering, or supply-chain abuse
- Access to connected services may be misused depending on account privileges
General mitigation guidance
Mitigation generally focuses on reducing trust in recipe content and preventing configuration fields from directly invoking arbitrary commands.
Common defensive patterns include:
- Treating recipes and their extensions as untrusted input by default
- Applying uniform security inspection to
stdio, retry, and other command-capable fields - Replacing arbitrary shell execution with narrowly scoped, allowlisted operations
- Requiring explicit user approval for commands originating from external recipes
- Running goose with a dedicated, least-privileged account and restricted filesystem access
- Limiting environment variables, credentials, network access, and process capabilities available to recipe execution
- Enforcing recipe provenance, review, and policy checks before distribution or execution
How teams detect issues like this
Detection can include static analysis and policy checks for command execution paths reachable from recipe parsing, especially handlers for stdio extensions and retry.checks.
Code review should look for configuration fields that bypass security scanners, shell invocation based on recipe data, inconsistent validation across recipe sections, and execution under accounts with broad privileges. Runtime monitoring can alert on unexpected child processes, shell interpreters, file changes, or network connections initiated by goose. Automated review tools and CI policies can help enforce allowlists and reject recipes containing unapproved command-capable constructs.

