Skip to content
OpenAdvisories
Critical · 9.8 Known exploited Scanner template Public exploit CVE-2017-9841 EUVD-2022-1528GHSA-r7c9-c69m-rph8

Code Injection in PHPUnit

Published Jun 27, 2017 · Updated Oct 21, 2025 · Assigned by mitre

Description

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP code via HTTP POST data beginning with a "<?php " substring, as demonstrated by an attack on a site with an exposed /vendor folder, i.e., external access to the /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php URI.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 phpunit 5.4.6-2 —
Debian 13 phpunit 5.4.6-2 —
Debian 12 phpunit 5.4.6-2 —
ReleasePackageFixed inAdvisory
Ubuntu Pro 16.04 LTS phpunit 5.1.3-1+ubuntu3+esm1 USN-7171-1

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Exploit-DB 1

GitHub 18 repositories · most starred shown

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Automated scanner template

A ready-made Nuclei template detects this vulnerability automatically. Vulnerabilities with public scanner templates are typically probed across the internet soon after the template appears — exposed systems should be patched first.

Source: projectdiscovery/nuclei-templates (MIT) — updated daily. Only links are listed.

Affected packages

EcosystemPackageAffectedFixedRecord
Packagist phpunit/phpunit >= 4.8.19, < 4.8.28 4.8.28 GHSA-r7c9-c69m-rph8
Packagist phpunit/phpunit >= 5.0.10, < 5.6.3 5.6.3 GHSA-r7c9-c69m-rph8

Advisories 1

References