Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 652420 - <dev-lang/php-{5.6.35-r1,7.0.29,7.1.16,7.2.4}: Possible disclosure in memory
Summary: <dev-lang/php-{5.6.35-r1,7.0.29,7.1.16,7.2.4}: Possible disclosure in memory
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Security
URL: http://bugs.php.net/75605
Whiteboard: B4 [noglsa]
Keywords:
Depends on:
Blocks: CVE-2018-7584
  Show dependency tree
 
Reported: 2018-04-04 14:28 UTC by Brian Evans (RETIRED)
Modified: 2018-05-27 15:58 UTC (History)
1 user (show)

See Also:
Package list:
dev-lang/php-5.6.35-r1 dev-lang/php-7.0.29 dev-lang/php-7.1.16
Runtime testing required: ---
stable-bot: sanity-check+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Evans (RETIRED) gentoo-dev 2018-04-04 14:28:13 UTC
CVE is pending

From the upstream bug:

Description:
------------
This was tested with PHP 5.6.32, but the behavior looks identical in newer versions of PHP.

After changing UID and GID, PHP-FPM sets pool worker processes to be dumpable. This allows a local user with the same UID and GID to attach to the PHP-FPM workers and gain access to any restricted resources that are not supposed to be allowed.

For a simple example:

- Configure PHP-FPM under Apache with two pools running as different users (victim & attacker)

- Enable opcache and configure it safely for a multiuser environment (opcache.validate_permission=1). The example here is also assuming a MMAP cache.

- Install wordpress in the victim account's docroot and load a few wordpress URLs.

- Install a PHP script that sleeps 60 seconds into the "attacker" account's docroot.

- Load the sleep script in the attacker account's docroot.

- As the attacker account, run "gcore <php-fpm-worker-pid>" to create a coredump of the PHP-FPM worker process.

- Run strings on the coredump file to retrieve the victim account's wordpress database username and password.

Expected result:
----------------
It should not be possible for unprivileged users to ptrace() the FPM worker processes or cause them to dump core.

Actual result:
--------------
Sensitive configuration data for other accounts can be accessed directly in the PHP worker process's memory.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2018-04-04 14:33:25 UTC
@ Arches,

please test and mark stable:

  =dev-lang/php-5.6.35-r1
  =dev-lang/php-7.0.29
  =dev-lang/php-7.1.16
Comment 2 Larry the Git Cow gentoo-dev 2018-04-05 06:08:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e9623fa7915d1dab1287ca3d88d2993f9b0bc30

commit 2e9623fa7915d1dab1287ca3d88d2993f9b0bc30
Author:     Rolf Eike Beer <eike@sf-mail.de>
AuthorDate: 2018-04-05 05:42:11 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-04-05 06:08:15 +0000

    dev-lang/php: stable 7.1.16 for sparc
    
    Bug: https://bugs.gentoo.org/652420
    Package-Manager: Portage-2.3.24, Repoman-2.3.6
    RepoMan-Options: --include-arches="sparc"

 dev-lang/php/php-7.1.16.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f01173541d3924e80d84c04e89afbab1d803268

commit 9f01173541d3924e80d84c04e89afbab1d803268
Author:     Rolf Eike Beer <eike@sf-mail.de>
AuthorDate: 2018-04-05 05:40:46 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-04-05 06:08:15 +0000

    dev-lang/php: stable 7.0.29 for sparc
    
    Bug: https://bugs.gentoo.org/652420
    Package-Manager: Portage-2.3.24, Repoman-2.3.6
    RepoMan-Options: --include-arches="sparc"

 dev-lang/php/php-7.0.29.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ede0d2048604118a58c448d94c35534e19c7a8e1

commit ede0d2048604118a58c448d94c35534e19c7a8e1
Author:     Rolf Eike Beer <eike@sf-mail.de>
AuthorDate: 2018-04-05 05:39:21 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-04-05 06:08:15 +0000

    dev-lang/php: stable 5.6.35-r1 for sparc
    
    Bug: https://bugs.gentoo.org/652420
    Package-Manager: Portage-2.3.24, Repoman-2.3.6
    RepoMan-Options: --include-arches="sparc"

 dev-lang/php/php-5.6.35-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}
Comment 3 Larry the Git Cow gentoo-dev 2018-04-05 13:21:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3be98a5dcec121d5df314a279428132a88d63e80

commit 3be98a5dcec121d5df314a279428132a88d63e80
Author:     Aaron Bauman <bman@gentoo.org>
AuthorDate: 2018-04-05 13:20:41 +0000
Commit:     Aaron Bauman <bman@gentoo.org>
CommitDate: 2018-04-05 13:20:41 +0000

    dev-lang/php: amd64 stable
    
    Bug: https://bugs.gentoo.org/652420
    Package-Manager: Portage-2.3.28, Repoman-2.3.9

 dev-lang/php/php-5.6.35-r1.ebuild | 2 +-
 dev-lang/php/php-7.0.29.ebuild    | 2 +-
 dev-lang/php/php-7.1.16.ebuild    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)}
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2018-04-05 13:43:28 UTC
x86 stable
Comment 5 Tobias Klausmann (RETIRED) gentoo-dev 2018-04-05 16:11:12 UTC
Stable on alpha.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-07 22:40:37 UTC
ia64 stable
Comment 7 Markus Meier gentoo-dev 2018-04-14 11:40:37 UTC
arm stable
Comment 8 Brian Evans (RETIRED) gentoo-dev 2018-05-14 19:51:43 UTC
hppa is no longer a security arch
Comment 9 Brian Evans (RETIRED) gentoo-dev 2018-05-14 19:52:58 UTC
This bug's CVE ID is 2018-10545
Comment 10 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2018-05-26 09:51:19 UTC
ppc/ppc64 stable
Comment 11 Aaron Bauman (RETIRED) gentoo-dev 2018-05-26 14:26:02 UTC
@maintainer(s), please clean.
Comment 12 Larry the Git Cow gentoo-dev 2018-05-27 15:12:10 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31189ba8d3a627d1aa2964dde9410316a7e037d2

commit 31189ba8d3a627d1aa2964dde9410316a7e037d2
Author:     Brian Evans <grknight@gentoo.org>
AuthorDate: 2018-05-27 15:11:51 +0000
Commit:     Brian Evans <grknight@gentoo.org>
CommitDate: 2018-05-27 15:11:51 +0000

    dev-lang/php: Clean up security vulnerable versions
    
    Bug: https://bugs.gentoo.org/652420
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 dev-lang/php/Manifest          |   6 -
 dev-lang/php/php-5.6.33.ebuild | 771 ----------------------------------------
 dev-lang/php/php-5.6.34.ebuild | 775 -----------------------------------------
 dev-lang/php/php-7.0.27.ebuild | 741 ---------------------------------------
 dev-lang/php/php-7.0.28.ebuild | 745 ---------------------------------------
 dev-lang/php/php-7.1.13.ebuild | 723 --------------------------------------
 dev-lang/php/php-7.1.15.ebuild | 727 --------------------------------------
 7 files changed, 4488 deletions(-)