From c62f6250761422d60d6fa05f9f9e43fff2da9f57 Mon Sep 17 00:00:00 2001 From: mcuiza Date: Wed, 27 Apr 2016 16:02:03 -0400 Subject: [PATCH] HOR-877: Very High: OS Command Injection Package.php --- gulliver/thirdparty/pear/PEAR/Command/Package.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gulliver/thirdparty/pear/PEAR/Command/Package.php b/gulliver/thirdparty/pear/PEAR/Command/Package.php index 8c4248260..b7bf6fd83 100755 --- a/gulliver/thirdparty/pear/PEAR/Command/Package.php +++ b/gulliver/thirdparty/pear/PEAR/Command/Package.php @@ -444,6 +444,20 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm function doPackageDependencies($command, $options, $params) { + if (!class_exists('G')) { + $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); + $docuroot = explode( '/', $realdocuroot ); + array_pop( $docuroot ); + $pathhome = implode( '/', $docuroot ) . '/'; + array_pop( $docuroot ); + $pathTrunk = implode( '/', $docuroot ) . '/'; + require_once($pathTrunk.'gulliver/system/class.g.php'); + } + + G::LoadSystem('inputfilter'); + $filter = new InputFilter(); + $command = $filter->validateInput($command); + // $params[0] -> the PEAR package to list its information if (sizeof($params) != 1) { return $this->raiseError("bad parameter(s), try \"help $command\"");