Horizon Alert
Summary of the vulnerability and why it matters
This advisory addresses a critical vulnerability in a GitHub action used for setting up PHP environments. The issue allows for command injection, potentially impacting the integrity of code execution within GitHub Actions workflows.
- Input validation flaw in a PHP setup tool.
- Affects automated build processes and code integrity.
- Confirm relevance and exposure in your CI/CD pipelines.
Attack Path
How an attacker could exploit the issue
An attacker could exploit this by controlling files within a repository. When a GitHub Actions workflow checks out this repository and then uses the setup-php GitHub Action, the action might incorporate values from these attacker-controlled files into scripts. If these values are not properly constrained, they could allow an attacker to run arbitrary commands on the GitHub Actions runner.
- No specific user interaction needed.
- Malicious repository files.
- Command execution on runner.
Live Threat
Current exploitation, exposure, and threat context
This vulnerability could allow an attacker to inject malicious commands into scripts generated by the `setup-php` GitHub action. This may occur when a workflow, such as a `pull_request_target`, checks out untrusted code before the action is invoked, leading to the execution of arbitrary code on the GitHub Actions runner.
- Runner command execution.
- Untrusted code checkout before action execution.
- Arbitrary command execution on runner.
Operational Fix
Recommended remediation, mitigation, and detection steps
Responsible teams should first identify all GitHub Actions workflows utilizing `setup-php`, confirm their exposure via `pull_request_target` or similar triggers, and then ascertain the business criticality of affected repositories. Coordination with the development or platform engineering teams responsible for CI/CD pipelines will be necessary to plan remediation, which may involve updating the GitHub Action or modifying workflow configurations to mitigate risk.
- Identify affected GitHub Action workflows.
- Verify workflow triggers and repository criticality.
- Update GitHub Action or workflow configurations.