CVE-2026-46420

Source
https://cve.org/CVERecord?id=CVE-2026-46420
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46420.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-46420
Aliases
Published
2026-07-17T19:51:10.253Z
Modified
2026-08-20T03:54:21.970669958Z
Severity
  • 5.6 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
setup-php: Command Injection in Repository-Derived PHP Version Resolution
Details

setup-php is a GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and tools. From 2.25.0 prior to 2.37.1, shivammathur/setup-php resolves the PHP version from repository-controlled files such as .php-version, composer.lock through platform-overrides.php, and composer.json through config.platform.php, and insufficiently constrains those values before incorporating them into generated shell or PowerShell setup scripts, allowing command injection on a GitHub Actions runner when workflows such as pullrequesttarget check out attacker-controlled contents before invoking setup-php. This issue is fixed in version 2.37.1.

Database specific
{
    "cwe_ids": [
        "CWE-78"
    ],
    "cna_assigner": "GitHub_M",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46420.json"
}
References

Affected packages

Git / github.com/shivammathur/setup-php

Affected ranges

Type
GIT
Repo
https://github.com/shivammathur/setup-php
Events
Database specific
Show details
{
    "source": [
        "CPE_RANGE",
        "REFERENCES"
    ],
    "cpe": "cpe:2.3:a:shivammathur:setup_php:*:*:*:*:*:*:*:*",
    "extracted_events": [
        {
            "introduced": "2.25.0"
        },
        {
            "fixed": "2.37.1"
        }
    ]
}

Affected versions

2.*
2.25.0
2.25.1
2.25.2
2.25.3
2.25.4
2.25.5
2.26.0
2.27.0
2.27.1
2.28.0
2.29.0
2.30.0
2.30.1
2.30.2
2.30.3
2.30.4
2.30.5
2.31.0
2.31.1
2.32.0
2.33.0
2.34.0
2.34.1
2.35.0
2.35.1
2.35.2
2.35.3
2.35.4
2.35.5
2.36.0
2.37.0

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-46420.json"