PHP: Arbitrary code execution — GLSA 201910-01

A vulnerability in PHP might allow an attacker to execute arbitrary code.

Affected packages

dev-lang/php on all architectures
Affected versions < 7.1.33
< 7.2.24
< 7.3.11
< 5.6.40-r7
Unaffected versions >= 7.1.33
>= 7.2.24
>= 7.3.11
>= 5.6.40-r7

Background

PHP is an open source general-purpose scripting language that is especially suited for web development.

Description

A underflow in env_path_info in PHP-FPM under certain configurations can be exploited to gain remote code execution.

Impact

A remote attacker, by sending special crafted HTTP requests, could possibly execute arbitrary code with the privileges of the process, or cause a Denial of Service condition.

Workaround

If patching is not feasible, the suggested workaround is to include checks to verify whether or not a file exists before passing to PHP.

Resolution

All PHP 5.6 users should upgrade to the latest version:

 # emerge --sync
 # emerge --ask --oneshot --verbose ">=dev-lang/php-5.6.40-r7"
 

All PHP 7.1 users should upgrade to the latest version:

 # emerge --sync
 # emerge --ask --oneshot --verbose ">=dev-lang/php-7.1.33"
 

All PHP 7.2 users should upgrade to the latest version:

 # emerge --sync
 # emerge --ask --oneshot --verbose ">=dev-lang/php-7.2.24"
 

All PHP 7.3 users should upgrade to the latest version:

 # emerge --sync
 # emerge --ask --oneshot --verbose ">=dev-lang/php-7.3.11"
 

References

Release date
October 25, 2019

Latest revision
November 19, 2019: 2

Severity
high

Exploitable
remote

Bugzilla entries