git-worktree-workflow
Warn
Audited by Gen Agent Trust Hub on Feb 21, 2026
Risk Level: MEDIUMCOMMAND_EXECUTION
Full Analysis
- COMMAND_EXECUTION (MEDIUM): Vulnerability in
scripts/worktree-merge.shusingevalon unvalidated input. \n - Description: The script constructs a
MERGE_CMDstring using theSTORY_IDargument (which formsBRANCH_NAME) and executes it viaeval. This allows an attacker to perform command injection by providing aSTORY_IDcontaining shell metacharacters (e.g.,;,|,&, or backticks). \n - Evidence: Line 140 in
scripts/worktree-merge.shcontainseval \"$MERGE_CMD\", whereMERGE_CMDincludes the unvalidatedBRANCH_NAMEvariable. \n - Risk Context: In an AI agent environment, if an agent is directed to process a story ID from an untrusted source (like a PR description or external task tracker) and passes it to this script, it could result in arbitrary code execution on the host machine.
Audit Metadata