Code Injection in PHPUnit
The advisory, in context
Util/PHP/eval-stdin.php in PHPUnit starting with 4.8.19 and before 4.8.28, as well as 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.
Affected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
From 4.8.19 before 4.8.28
Fixed in 4.8.28
9 explicitly affected versions
4.8.19, 4.8.20, 4.8.21, 4.8.22, 4.8.23, 4.8.24, 4.8.25, 4.8.26, 4.8.27
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "4.8.19"
},
{
"fixed": "4.8.28"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"4.8.19",
"4.8.20",
"4.8.21",
"4.8.22",
"4.8.23",
"4.8.24",
"4.8.25",
"4.8.26",
"4.8.27"
]
}From 5.0.10 before 5.6.3
Fixed in 5.6.3
48 explicitly affected versions
5.0.10, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5, 5.1.6, 5.1.7, 5.2.0, 5.2.1, 5.2.10, 5.2.11, 5.2.12, 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 5.2.7, 5.2.8, 5.2.9, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.4, 5.3.5, 5.4.0, 5.4.1, 5.4.2, 5.4.3, 5.4.4, 5.4.5, 5.4.6, 5.4.7, 5.4.8, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 5.5.4, 5.5.5, 5.5.6, 5.5.7, 5.6.0, 5.6.1, 5.6.2
View affected-version evidence
{
"ranges": [
{
"events": [
{
"introduced": "5.0.10"
},
{
"fixed": "5.6.3"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"5.0.10",
"5.1.0",
"5.1.1",
"5.1.2",
"5.1.3",
"5.1.4",
"5.1.5",
"5.1.6",
"5.1.7",
"5.2.0",
"5.2.1",
"5.2.10",
"5.2.11",
"5.2.12",
"5.2.2",
"5.2.3",
"5.2.4",
"5.2.5",
"5.2.6",
"5.2.7",
"5.2.8",
"5.2.9",
"5.3.0",
"5.3.1",
"5.3.2",
"5.3.3",
"5.3.4",
"5.3.5",
"5.4.0",
"5.4.1",
"5.4.2",
"5.4.3",
"5.4.4",
"5.4.5",
"5.4.6",
"5.4.7",
"5.4.8",
"5.5.0",
"5.5.1",
"5.5.2",
"5.5.3",
"5.5.4",
"5.5.5",
"5.5.6",
"5.5.7",
"5.6.0",
"5.6.1",
"5.6.2"
]
}References
- https://nvd.nist.gov/vuln/detail/CVE-2017-9841
- https://github.com/sebastianbergmann/phpunit/pull/1955
- https://github.com/sebastianbergmann/phpunit/pull/1956
- https://github.com/sebastianbergmann/phpunit/commit/284a69fb88a2d0845d23f42974a583d8f59bf5a5
- https://github.com/sebastianbergmann/phpunit/commit/3aaddb1c5bd9b9b8d070b4cf120e71c36fd08412
- https://github.com/FriendsOfPHP/security-advisories/blob/master/phpunit/phpunit/CVE-2017-9841.yaml
- https://github.com/sebastianbergmann/phpunit
- https://security.gentoo.org/glsa/201711-15
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2017-9841
- https://www.oracle.com/security-alerts/cpuoct2021.html
- http://web.archive.org/web/20170701212357/http://phpunit.vulnbusters.com
- http://www.securityfocus.com/bid/101798
- http://www.securitytracker.com/id/1039812