[HSC] Multiple transversal bug in vis



Hackers Center Security Group (http://www.hackerscenter.com/)
spher3's Security Advisory

Multiple transversal bug in vis.pl


--------------------------------------------------------------------------

Description:

Vis.pl is a perl script which manages files in order to show these;
you can find it in e-cms default files. The vulnerability taken in
exam is classifiable as transversal bug. In fact can show to everybody
files such as passwords or accounts.

--------------------------------------------------------------------------

Code Details:

Vis.pl doesn't control cgi query except for:

[...]

if ( -e $datFile )
{
open ( DAT_FILE, "$datFile" );

[...]

This function controls only the file existence.
Then the script start to open the file without check dangerous
characters as "." and "/".
So is simply to access where you want:

http://[target]/cgi-bin/e-cms/vis/vis.pl?s=001&p=../../../../etc/passwd%00

All variables that open files are unsafe:

http://[target]/cgi-bin/e-cms/vis/vis.pl?s=../../../../etc/passwd%00

--------------------------------------------------------------------------

How to fix:

You can fix this script with remove those dangerouse characters as taught
from W3C WWW Security FAQ. Just adding a line:

$datFile = s/\.\.//g;

You have to insert a line like this for ALL variables which contain files
to open.



Relevant Pages

  • Re: Help Needed with Perl cgi script and spam problem
    ... worded it as "how can I learn about security in web programming" ... specific to your own script. ... "fix it". ...
    (comp.lang.perl)
  • SUMMARY WAS: OT? Philosophical Question on SA responsibilities
    ... helpful for managers interested in hiring new administrators. ... Would you go thru the 14,600 messages in root and admin ... If I was a new SA I would if encountering a security hole, ... I can see some use for the passwd -s part of the crontab script, ...
    (SunManagers)
  • Re: Clarification-Win2k Netstat sockets interpretation
    ... snip.. ... Before I could manually download every security upate and servicepack from MS.com but now...they send you a bit of Cop-code that fails to run unless ALL defences are down ... Are you sure the script from ntsvcfg is benign in addition to being useful? ... You are absolutely correct there HAL, er ah, Sebastian. ...
    (alt.computer.security)
  • [NT] Flaw in Windows Script Engine Could Allow Code Execution
    ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... The Windows Script Engine provides Windows operating systems with the ... blocked by Outlook Express 6.0 and Outlook 2002 in their default ...
    (Securiteam)
  • Re: BUG with RES/SCRIPT/XP-SP2
    ... I consider JavaScript (known to security people as JavaVirus) as one of the Really Top ... to have a bad script cause damage to my machine. ... This security feature is called the "Local Machine Zone Lockdown". ... Tags, and the CDHtmlDialog class in this forum, and got no response. ...
    (microsoft.public.vc.mfc)