Summary
PraisonAI's bundled Claude GitHub Actions workflow may execute attacker-controlled pull request branch names as shell commands. An outside contributor can trigger the workflow through a pull request comment, potentially causing arbitrary code execution in a privileged GitHub Actions runner.
Affected context
The vulnerability affects PraisonAI deployments that use the bundled Claude GitHub Actions workflow in versions before 4.6.40. Risk is present when the workflow inserts an untrusted pull request branch name into a Bash run block without adequate quoting or validation and permits comments from untrusted users to trigger the job. The impact is increased when the runner has write-capable GitHub tokens, OIDC access, or repository management permissions.
Exploit preconditions
- Attack surface: GitHub Actions workflow handling pull request events and comments
- Required access: Ability to open a pull request from an external fork and submit a qualifying workflow-triggering comment
- Trigger point: Shell execution in the Claude workflow after the pull request comment is processed
- Why exploitation is possible: An attacker-controlled branch name is incorporated into a Bash command without reliable shell-safe handling, while authorization checks do not sufficiently restrict who may trigger the workflow
- Privilege condition: The workflow must receive permissions or credentials that allow actions beyond the minimum required for the job
Why this happens
The underlying issue combines unsafe interpolation of attacker-controlled data into a shell command with insufficient authorization of workflow triggers. Values originating from pull request metadata are treated as command text rather than inert data, creating a command-injection condition commonly associated with CWE-78, while the missing trust check for comment-based activation maps to the supplied CWE-862, Missing Authorization. The workflow also exposes a broader trust-boundary failure by allowing untrusted contribution activity to reach privileged automation.
Potential impact
- Arbitrary code execution on the GitHub Actions runner may occur
- Repository contents, branches, issues, or pull requests could be modified
- Credentials or tokens available to the job could be exposed or misused
- OIDC-backed cloud access could be abused
- Later workflow steps could be influenced through modified runner environment state
- The repository's build and release supply chain could be compromised
General mitigation guidance
Mitigation generally focuses on separating untrusted pull request data from shell syntax and reducing the privileges available to automation.
Common defensive patterns include:
- Treating branch names, comments, and other event metadata strictly as data
- Avoiding shell interpolation for untrusted values and using safe argument-passing mechanisms
- Restricting comment-triggered workflows to explicitly authorized collaborators or trusted events
- Separating fork-based validation jobs from privileged repository-maintenance jobs
- Applying least-privilege permissions to
GITHUB_TOKEN, GitHub App credentials, and OIDC trust policies - Avoiding write permissions and cloud identity access unless a job demonstrably requires them
- Preventing untrusted steps from influencing later privileged workflow steps
- Using protected environments and approval gates for sensitive operations
How teams detect issues like this
Detection approaches can include:
- Static analysis for event metadata interpolated into shell
runblocks - Code review checks for unquoted branch names, comments, labels, or commit fields used in commands
- Workflow policy rules that flag privileged jobs triggered by fork pull requests or unrestricted comments
- Auditing token, OIDC, repository-write, and environment permissions granted to jobs processing untrusted input
- Monitoring workflow logs and audit events for unexpected repository changes, token use, or runner environment modifications
- Automated workflow security review tools can help identify unsafe interpolation and excessive permissions

