[UNIX] SWS Web Server Multiple Vulnerabilities

From: support@securiteam.com
Date: 09/12/02


From: support@securiteam.com
To: list@securiteam.com
Date: Thu, 12 Sep 2002 09:00:33 +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.
- - - - - - - - -

  SWS Web Server Multiple Vulnerabilities
------------------------------------------------------------------------

SUMMARY

 <http://www.linuxprogramlama.com> SWS Web server is a 160 lines of .c web
server for Linux. The product has been found to contain multiple security
vulnerabilities.

DETAILS

Vulnerable systems:
 * SWS Web Server version 0.1.1 and version 0.1.2

Bug description:
Multiple vulnerabilities exist in the SWS Web server:

1. Server does not drop root privileges.

2. Server does not check directory traversal (../) allowing access to any
file with root privileges.

3. Server has buffer overflow when it tries to read files that are longer
than 4050 bytes

char buffer[4050];
..
while((i=fread(buffer,1,4096, f)) > 0)

This has the potential of allowing code execution with root privileges.

4. If a 404-error message is configured on SWS server, a vulnerability in
the code causes the file descriptor for 404 messages to no close, allowing
a DoS against whole system.

        if ( (f=fopen(hatasayfasi,"r") )==NULL)
                {
                write_err_log ("Uyar+ hatasayfas+ bulunamad+.");
// write_err_log ("Warning hatasayfasi not found, edit
/etc/sws.conf ");
                return 0;
                }
        }

5. Server is limited to one connection in time and never checks any
timeouts allowing a DoS against the server.

6. If recv() fails

                        i = recv(sock, recvBuffer, 4000, 0);
                        if (i == -1) write_err_log("Okuma hatal+...");
                        //write_err_log("Reading wrong...");
                        recvBuffer[i] = '\0';
..
cp = buf + 5;
cp2 = strstr(cp, " HTTP");

1 byte before the dynamically allocated buffer is overwritten with zero
and strstr() is called to access that un-initialized data.

ADDITIONAL INFORMATION

The information has been provided by <mailto:3APA3A@SECURITY.NNOV.RU>
3APA3A.

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

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: FTP Tagging anyone?
    ... > secured against various different kinds of vulnerabilities, ... formatting the system is probably not necessary. ... baseline server looks like, so they can't tell what is and isn't suspicious ... this depends on your security needs. ...
    (microsoft.public.inetserver.iis.security)
  • Multiple Vulnerabilities Sybase Anywhere 9
    ... NGSSoftware Insight Security Research Advisory ... Multiple Vulnerabilities in Adaptive Server Anywhere Network Server ... attack allowing an authenticated user to escalate privileges to 'dba' within ...
    (NT-Bugtraq)
  • security-basics Digest of: get.123_145
    ... VPN to ASP a security risk? ... Re: Multiple IPSec tunnels? ... Subject: Security NT Server ... VPN to ASP a security risk? ...
    (Security-Basics)
  • << SBS News of the week - Sept 26 >>
    ... And he points to the info you need to put the file on the server in the ... at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... by the firewall at risk. ...
    (microsoft.public.backoffice.smallbiz2000)
  • Re: << SBS News of the week - Sept 26 >>
    ... > And he points to the info you need to put the file on the server in the ... > at the network perimeter. ... The Symantec Firewall/VPN and the Gateway Security ... An attacker can exploit these flaws in tandem via specially ...
    (microsoft.public.backoffice.smallbiz2000)