[UNIX] DPGS Allows Any File to Be Overwritten

From: support@securiteam.com
Date: 06/23/02


From: support@securiteam.com
To: list@securiteam.com
Date: Sun, 23 Jun 2002 21:25:52 +0200 (CEST)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  DPGS Allows Any File to Be Overwritten
------------------------------------------------------------------------

SUMMARY

 <http://lobsanov.com/ilia/DPGS/> DPGS is a free and open-source tool for
enhancing virtual communities, discussion groups and message boards with
dynamically generated photographic member profiles. A security
vulnerability in the product allows overwriting of any file we desire.

DETAILS

NOTE:
It is important to note that this project has been discontinued as of July
30, 2000, therefore administrator should not use this product or should
find a replacement for it as soon as possible.

Vulnerable code:
open(DATABASE, ">$path_to_members/$FORM{'id'}/data.txt") ||
&error("Couldn't write $path_to_members/$FORM{'id'}/data.txt");

while ( ($form_key, $form_value) = each(%FORM) ) {
print DATABASE "$form_key$delimiter$form_value\n" unless
( $form_value eq '' || $form_key eq "id" || $form_key =~ "password" ); }
close(DATABASE);

This will open the database of this user and then try to add data to the
database. Now here is what %FORM is filtered by in DPGS.pll:
        $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
        $value =~ s/<([^>]|\n)*>//g;
        $value =~ s/<!--(.|\n)*-->//g; #removes any server side includes
        $value =~ s/^\s+//; #remove any leading spaces
        $value =~ s/\s+$//; #remove any trailing spaces
        $value =~ s/$delimiter//g; #remove delimiters if any.
        $value =~ s/\"/\&quot\;/g; #replace quotes with "
        $value =~ s/\r\n/<BR>/g; #replace new line characters with <BR>
        $FORM{$name} = $value;
}

None of these stops directory transversal or the null byte. So if we sign
up with an id of ../../etc/passwd\0 then the /etc/passwd file will be the
one opened for writing. We can write to any file this way, even
overwriting other user's data.txt files or the administrator data file
'../admin'.

ADDITIONAL INFORMATION

The information has been provided by <mailto:b0iler@eyeonsecurity.net>
b0iler.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.



Relevant Pages

  • Re: setting a password on a button on the switchboard
    ... Could you send me the sample database for the fourth option (4. ... > Security in an Access database can probably be broken down into two big ... > points about being easier than User Level Security, ... > What type of data are you trying to protect? ...
    (microsoft.public.access.forms)
  • Re: access 2003
    ... security in access 2003. ... The data will go on the server and the program database ... than the alternative of creating an mde file. ... MDW file from the written record. ...
    (microsoft.public.access.conversion)
  • Re: access 2003
    ... security in access 2003. ... The data will go on the server and the program database ... than the alternative of creating an mde file. ... MDW file from the written record. ...
    (microsoft.public.access.conversion)
  • Re: Is this possible??
    ... I understand Windows security but since I've not seen A2007 live, ... The backend is on the server in it's own file. ... database, but everyone does not need to have access to tblwage which is ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Is it safe to use social securty number as intranet username? (long)
    ... > they expect us to use our social security number as a username. ... by some database application ... ... The gateway router runs radius for authenticating ... ISPs perform internet connection authentication) ...
    (comp.security.misc)