Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111525 - dev-php/PEAR-PEAR <=1.4.2 arbitrary code execution vulnerability
Summary: dev-php/PEAR-PEAR <=1.4.2 arbitrary code execution vulnerability
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Security
URL: http://pear.php.net/advisory-20051104...
Whiteboard: B2? [noglsa] DerCorny
Keywords:
: 118262 (view as bug list)
Depends on: 119461
Blocks:
  Show dependency tree
 
Reported: 2005-11-04 23:30 UTC by Andreas Korthaus
Modified: 2006-02-07 10:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Korthaus 2005-11-04 23:30:38 UTC
SECURITY VULNERABILITY ANNOUNCEMENT
November 4, 2005

     Advisory: PEAR installer arbitrary code execution vulnerability
 Release Date: 2005/11/04
Last Modified: 2005/11/04
       Author: Gregory Beaver [cellog@php.net]

  Application: PEAR installer <= 1.4.2
     Severity: A standard feature of the PEAR installer implemented in
               all versions of PEAR can lead to the execution of
               arbitrary PHP code upon running the "pear" command
               or loading the Web/Gtk frontend.
         Risk: Low
Vendor Status: The PEAR project has released an updated version
   References: http://pear.php.net/advisory-20051104.txt


Overview:

  The PEAR installer is available from http://pear.php.net/package/PEAR.
The PEAR installer is used to install PHP-based software packages
distributed from pear.php.net and PHP extensions from pecl.php.net.  As
of version 1.4.0, the PEAR installer can also install software packages
from other sources, known as "channels."

A poorly-implemented feature allows a package installed by the PEAR
installer to execute arbitrary code any time the "pear" command is
executed or the Web/Gtk frontend is loaded.

Details:

  To be vulnerable, a user must explicitly install a publicly released
malicious package using the PEAR installer, or explicitly install a
package that depends on a malicious package.

Full details of the vulnerability will be released at a later date.

Proof of concept:

  The PEAR development team will not release an example exploit to the
public.

Disclosure Timeline:

  01. November 2005 - vulnerability discovered by Gregory Beaver
  02. November 2005 - possible solutions discussed privately
  03. November 2005 - The PEAR Project releases new bugfixed version
  04. November 2005 - Public disclosure

Recommendation:

  We strongly recommend to upgrade to the new version

  PEAR 1.4.3
  pear upgrade PEAR-1.4.3
  http://pear.php.net/get/PEAR-1.4.3.tgz

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Latest version is 1.4.4, not 1.4.3 (patched version did not work with PHP 4.2).

The pear installer is included in all php-archives. All php ebuilds depend on
vulnable PEAR versions, if "pear" USE flag is set. 

pear? ( >=dev-php/PEAR-PEAR-1.3.6 )

http://greg.chiaraquartet.net/archives/99-Security-Vulnerability-in-all-PEAR-versions-prior-to-1.4.3-discovered.html
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-04 23:33:44 UTC
php please advise. 
Comment 2 Sebastian Bergmann (RETIRED) gentoo-dev 2005-11-05 00:04:35 UTC
We have an ebuild for PEAR 1.4.X in our SVN Overlay, but that still needs some
work/testing PEAR 1.4.0 introduced a lot of changes to the PEAR infrastructure.
Comment 3 Andreas Korthaus 2005-11-05 00:26:39 UTC
I added an ebuild for PEAR-1.4.4 there, but as Sebastian wrote, PEAR-1.4 ebuilds
are in experimental tree of the overlay.

http://svn.gnqs.org/projects/gentoo-php-overlay/browser/experimental/dev-php/PEAR-PEAR/
Comment 4 Thierry Carrez (RETIRED) gentoo-dev 2005-11-05 09:45:09 UTC
"To be vulnerable, a user must explicitly install a publicly released malicious
package using the PEAR installer, or explicitly install a package that depends
on a malicious package."

If you install a malicious package, it's probably to run the code in it, so
you're pretty much already 0wned...
Comment 5 Thierry Carrez (RETIRED) gentoo-dev 2005-11-06 10:50:48 UTC
Anyway, this is minor, but should nevertheless be fixed. It can wait until it is
de-experimentalized, I suppose.
Comment 6 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-12-05 12:42:28 UTC
Any news on this one? 
Comment 7 Thierry Carrez (RETIRED) gentoo-dev 2005-12-09 06:58:25 UTC
Hm, any ETA for having latest PEAR in ? Otherwise I would just close this one,
it sucks anyway.
Comment 8 Thierry Carrez (RETIRED) gentoo-dev 2005-12-14 07:29:54 UTC
Bah, closing as wontfix, see comment #4. Feel free to upgrade the package though.
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2006-01-08 02:20:28 UTC
*** Bug 118262 has been marked as a duplicate of this bug. ***
Comment 11 Stefan Cornelius (RETIRED) gentoo-dev 2006-01-08 09:52:45 UTC
reopening like requested because of new information about the issue, waiting for ebuilds.
Comment 12 Thierry Carrez (RETIRED) gentoo-dev 2006-01-12 08:26:39 UTC
PHP herd, what would be your opinion on this ? I don't find the Why-it-is-very-important-to-upgrade-to-PEAR-1.4.6-from-PEAR-1.3.x.html very convincing.
Comment 13 Luca Longinotti (RETIRED) gentoo-dev 2006-01-12 08:54:16 UTC
Yeah, we'll anyway to try to have PEAR 1.4.X in the tree soon, as it is a "better" PEAR installer than 1.3.X, and it fixes the security bugs, but atm it's a no-go: only >=1.4.6 has the --packagingroot directive wich we need to let PEAR packages be built correctly in the sandbox, but atm PEAR 1.4.6 only gives us a Fatal Error and dies, so we can't really ship that... :) We'll try to fix that and have a working PEAR 1.4.X in the tree soon, I hope.
Best regards, CHTEKK.
Comment 14 Thierry Carrez (RETIRED) gentoo-dev 2006-01-13 06:49:42 UTC
There is also this thing, from Bugtraq... Not sure how accessible it is though.

=========================
A vulnerability exists within version 0.2.2 of go-pear.php, part of PHP's PEAR Package. 
The problem lies in the scripts capacity to utilize a proxy server.

An attacker can take advantage of this option by providing it with a malicious proxy server
that is configured to redirect the original request to another file server. 
By simply mirroring the requested content from the intended file server 
the attacker can assure the script continues running uninterrupted.

Hosting a modified version of "Tar.php" and pre pending code to the extractModify() function
will allow the attacker to run any PHP code of their choosing. This occurs because go-pear uses
"Tar.php" to extract all the packages it previously retrieved, in doing so it invokes the now
compromised version of extractModify().
=====================================
Comment 15 Luca Longinotti (RETIRED) gentoo-dev 2006-01-21 04:02:36 UTC
UPDATE: we got PEAR-1.4.6 working on the PHP Overlay, I'll do some more testing today and move it to the testing/ branch of the overlay, and then to Portage CVS on monday if there are no problems found. Once it's in Portage, I'll update this bug and we can see to have the arch-teams keyword it appropriately.
Best regards, CHTEKK.
Comment 16 Sebastian Bergmann (RETIRED) gentoo-dev 2006-01-21 04:05:09 UTC
Great news, Luca. Could you look at the issue I emailed you about (eZ components channel registration)? Thanks!
Comment 17 Sebastian Bergmann (RETIRED) gentoo-dev 2006-01-23 06:39:27 UTC
dev-php/PEAR-PEAR-1.4.6 is in the tree now.
Comment 18 Stefan Cornelius (RETIRED) gentoo-dev 2006-01-23 10:11:40 UTC
arches - please test and mark stable, thx.
Comment 19 Mark Loeser (RETIRED) gentoo-dev 2006-01-23 13:28:10 UTC
x86 done
Comment 20 Markus Rothe (RETIRED) gentoo-dev 2006-01-23 13:36:50 UTC
stable on ppc64
Comment 21 Gustavo Zacarias (RETIRED) gentoo-dev 2006-01-23 17:04:13 UTC
sparc stable.
Comment 22 Tobias Scherbaum (RETIRED) gentoo-dev 2006-01-24 06:32:46 UTC
ppc stable
Comment 23 Jeroen Roovers (RETIRED) gentoo-dev 2006-01-24 12:49:44 UTC
Marked ~hppa.
Comment 24 Simon Stelling (RETIRED) gentoo-dev 2006-01-24 14:07:38 UTC
amd64 stable
Comment 25 Stefan Cornelius (RETIRED) gentoo-dev 2006-01-24 14:24:21 UTC
re-CCing hppa as the keyword was removed by the php team to prohobit problems because of other packages that need to be stabled first, see bug #119461 for details.
Comment 26 René Nussbaumer (RETIRED) gentoo-dev 2006-01-25 12:52:58 UTC
We (hppa) have some problems with php at the moment. Because we aren't php 5 ready. I hope we'll fix it soon.
Comment 27 Bryan Østergaard (RETIRED) gentoo-dev 2006-01-25 15:48:24 UTC
Alpha stable.
Comment 28 Jakub Moc (RETIRED) gentoo-dev 2006-01-26 00:55:36 UTC
(In reply to comment #26)
> We (hppa) have some problems with php at the moment. Because we aren't php 5
> ready. I hope we'll fix it soon.

Killerfox, if you have issues w/ php-5 on hppa, please keyword dev-lang/php-4 (and related ebuilds) only meanwhile, you don't need php-5 keyworded for PEAR-PEAR-1.4.6-r1. Thanks.
Comment 29 Jeroen Roovers (RETIRED) gentoo-dev 2006-01-26 12:49:41 UTC
Marked stable on hppa. Removing CC.
Comment 30 Stefan Cornelius (RETIRED) gentoo-dev 2006-01-26 14:59:01 UTC
let's better have a glsa vote here ... i have no opinion yet, need to re-read all the dirty details before
Comment 31 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2006-01-30 13:41:35 UTC
I vote NO.
Comment 32 Daniel Black (RETIRED) gentoo-dev 2006-02-06 12:16:47 UTC
concur - vote=no glsa
Comment 33 Thierry Carrez (RETIRED) gentoo-dev 2006-02-07 10:16:55 UTC
Voting no and closing, this one doesn't smell right, see my comment #4