what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

surfboard-1.1.8.txt

surfboard-1.1.8.txt
Posted Dec 3, 2003
Authored by Luigi Auriemma | Site aluigi.altervista.org

The Surfboard webserver v1.1.8 and below contains remote directory traversal and denial of service vulnerabilities. Exploit URLs and a patch included.

tags | exploit, remote, denial of service, vulnerability
SHA-256 | 3dbbe78f6853a71fc44dfdf40f5fb21a8eec9d6276975bbbeb5bd302badc590f

surfboard-1.1.8.txt

Change Mirror Download

#######################################################################

Luigi Auriemma

Application: Surfboard webserver
http://surfd.sourceforge.net
Versions: <= 1.1.8
Platforms: *nix
Bugs: possibility to view all the files in the system and
resources consumption
Risk: medium/high
Exploitation: remote/easy
Date: 01 Dec 2003
Author: Luigi Auriemma
e-mail: aluigi@altervista.org
web: http://aluigi.altervista.org


#######################################################################


1) Introduction
2) Bug
3) The Code
4) Fix


#######################################################################

===============
1) Introduction
===============


>From the website:
"Surfboard is a trivial web server, written by Meredydd Luff."



#######################################################################

=======
2) Bugs
=======


Directory traversal
-------------------

The webserver checks the dot-dot pattern only if there is a '?' in the
URI (used for server side scripts), so there is no protection for the
classical directory traversal exploitation.
Note: fortunally the webserver doesn't support indexing of directories
and the version 1.0 is not affected by this bug.



Resource consumption
--------------------

The webserver uses a strange method to read the browser's input: it
does a loop until it receives a second line-feed.
Unfortunally the webserver doesn't check for errors so if the client
breaks the connection it will enter in an infinite loop and the process
(the webserver uses fork()) will be never terminated.




#######################################################################

===========
3) The Code
===========


Directory traversal
-------------------

http://server/../etc/passwd
http://server/../../../etc/passwd



Resource consumption
--------------------

Connect to the server with telnet or netcat and then close the
connection (without sending data).




#######################################################################

======
4) Fix
======


I have alerted the author a week ago, however patching the webserver is
very simple. The following patch can be applied to the 1.1.8 version:


--- surfboard.c 2001-04-11 19:23:36.000000000 +0000
+++ 1.c 2003-11-27 18:38:28.000000000 +0000
@@ -155,7 +155,7 @@
*/
while(1)
{
- while(read(s, &c, 1)<1);
+ if(read(s, &c, 1)<1) break;
if(c=='\r') { continue; }
if(c=='\n' && oldc=='\n') { break; }
oldc=c;
@@ -167,7 +167,7 @@
sprintf(buf, "Asked for %s", rawreq);
log_msg(LOG_DEBUG, buf);

- if(strstr(rawreq, "..")<strstr(rawreq, "?") || strstr(rawreq,
"`")<strstr(rawreq, "?"))
+ if((!strstr(rawreq, "?")&&strstr(rawreq, "..")) || strstr(rawreq,
"..")<strstr(rawreq, "?") || strstr(rawreq, "`")<strstr(rawreq, "?"))
{
log_msg(LOG_ERR, "Relative path and/or shell escape - ATTACK ATTEMPT");
add2header(http_header, "HTTP/1.1 400 Bad Request\r\n");


Details:
1) the reading loop will be terminated if we find an error
2) we check also the presence of the dot-dot pattern if there is no
'?' in the URI



#######################################################################


---
Luigi Auriemma
http://aluigi.altervista.org
Login or Register to add favorites

File Archive:

February 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Feb 1st
    16 Files
  • 2
    Feb 2nd
    19 Files
  • 3
    Feb 3rd
    0 Files
  • 4
    Feb 4th
    0 Files
  • 5
    Feb 5th
    24 Files
  • 6
    Feb 6th
    2 Files
  • 7
    Feb 7th
    10 Files
  • 8
    Feb 8th
    25 Files
  • 9
    Feb 9th
    37 Files
  • 10
    Feb 10th
    0 Files
  • 11
    Feb 11th
    0 Files
  • 12
    Feb 12th
    17 Files
  • 13
    Feb 13th
    20 Files
  • 14
    Feb 14th
    25 Files
  • 15
    Feb 15th
    15 Files
  • 16
    Feb 16th
    6 Files
  • 17
    Feb 17th
    0 Files
  • 18
    Feb 18th
    0 Files
  • 19
    Feb 19th
    35 Files
  • 20
    Feb 20th
    25 Files
  • 21
    Feb 21st
    18 Files
  • 22
    Feb 22nd
    15 Files
  • 23
    Feb 23rd
    0 Files
  • 24
    Feb 24th
    0 Files
  • 25
    Feb 25th
    0 Files
  • 26
    Feb 26th
    0 Files
  • 27
    Feb 27th
    0 Files
  • 28
    Feb 28th
    0 Files
  • 29
    Feb 29th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close