Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-46420: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in shivammathur setup-php

0
Medium
VulnerabilityCVE-2026-46420cvecve-2026-46420cwe-78
Published: 07/17/2026 (07/17/2026, 19:51:10 UTC)
Source: CVE Database V5
Vendor/Project: shivammathur
Product: setup-php

Description

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 pull_request_target check out attacker-controlled contents before invoking setup-php. This issue is fixed in version 2.37.1.

CVSS v3.1

Score 5.6medium

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L

Affected software

Affected versions
>=2.25.0 <2.37.1

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/18/2026, 11:51:24 UTC

Technical Analysis

The vulnerability in shivammathur/setup-php arises because it resolves PHP version information from files controlled by the repository (.php-version, composer.lock, composer.json) and incorporates these values into generated shell or PowerShell setup scripts without adequate sanitization. This improper neutralization of special elements leads to OS command injection on GitHub Actions runners when workflows such as pull_request_target check out attacker-controlled code before invoking setup-php. The vulnerability affects versions starting from 2.25.0 up to but excluding 2.37.1, where the issue has been fixed.

Potential Impact

An attacker able to control repository files and trigger vulnerable GitHub Actions workflows can execute arbitrary OS commands on the runner environment. This can lead to limited confidentiality, integrity, and availability impacts as indicated by the CVSS vector (low confidentiality, integrity, and availability impact).

Mitigation Recommendations

Upgrade shivammathur/setup-php to version 2.37.1 or later, where this command injection vulnerability is fixed. Until upgraded, avoid running workflows that check out untrusted repository content before invoking setup-php, especially workflows using pull_request_target. Patch status is not explicitly confirmed in the advisory, but the fix is stated to be in version 2.37.1.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-05-13T22:18:22.829Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 6a5b5eac2d1edb114c7fb21d

Added to database: 07/18/2026, 11:08:28 UTC

Last enriched: 07/18/2026, 11:51:24 UTC

Last updated: 07/18/2026, 13:12:58 UTC

Views: 5

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses