[39135] in bugtraq

home help back first fref pref prev next nref lref last post

Re: Arbitrary code execution in eping plugin

daemon@ATHENA.MIT.EDU (Oliver Monneke)
Mon Jun 13 13:50:55 2005

Message-ID: <42A9F99D.6040501@codersquad.de>
Date: Fri, 10 Jun 2005 22:35:41 +0200
From: Oliver Monneke <oliver@codersquad.de>
MIME-Version: 1.0
To: y0int@yahoo.it, bugtraq@securityfocus.com
In-Reply-To: <20050609161743.28069.qmail@securityfocus.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

the problem is in function eping_validaddr() in functions.php where the 
host is checked if it is valid as the name says...
But the only check is to see if it is a valid ip adress for eping, here 
is the code:

--------------8<-----------------------------------------8<-------------------------------------
function eping_validaddr($eping_hosttocheck)
{
If 
(ereg("(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", 
$eping_hosttocheck))
    {
        return true;
    }
    else
    {
        return false;
    }
--------------8<-----------------------------------------8<-------------------------------------

I am sorry but I am a coder and my eyes are bleeding when looking at 
stuff like that so here is my suggestion for replaceing the if-statement:
if(preg_match("/^[0-9]{2,3}?\.[0-9]{1,3}?\.[0-9]{1,3}?\.[0-9]{1,3}?$/", 
$eping_hosttocheck))

So only IP-Adresses are allowed and no kind of code injection is possible.

And everyone who thinks 'will he ever stop writeing?' will be disappointed:
The same vulnerability also exists in the eTrace modul from E107. It 
looks like the same Author of the ePing modul.
The only difference is the you have to search for 'etrace' instead of 
'eping' in the files

Greetings from Germany
Oliver

-- 

use the force - treat the source
http://codersquad.de


home help back first fref pref prev next nref lref last post