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

thttpd-219.txt

thttpd-219.txt
Posted Oct 5, 2000
Authored by Ghandi | Site dopesquad.net

Thttpd 2.19 and below includes a CGI program "ssi" which contains a vulnerability which allows remote users to read any file on the webserver. Exploit examples included. Fix available here.

tags | exploit, remote, cgi
SHA-256 | 5cf4c016185b6b2c6b33bf5944ac239ead66ec315980d03e497f790eea3acb5b

thttpd-219.txt

Change Mirror Download
      thttpd 2.19 (and earlier) server-side-includes
CGI program (ssi) allows retrieval of arbitrary
world-readable files

Date: October 2, 2000
Application: thttpd 2.19 (and before)
Author: ghandi <ghandi@dopesquad.net>
Vendor Status: merged patches into thttpd 2.20
Fix: upgrade into thttpd 2.20

1. Description

The included cgi-bin program "ssi" (combined with a lesser bug in the
thttpd server) allows the viewing of arbitrary files on the remote
server. This includes files outside of the web root and files in
cgi-bin directories (that would normally only be executed). However,
only files readable by the user that the server is running under
(usually user 'nobody') can be viewed. This typically limits the
exposure to world-readable files only.

2. Details

>From ssi(8):
This is an external CGI program that gives you the same
functionality as the built-in server-side-includes feature
in some HTTP daemons. It is written for use with
thttpd(8), but should be easy to adapt to other systems.

Files to be parsed are passed to ssi as the "pathinfo" (their path is
appended to the path to ssi). For example, to parse the file
accessible at:
https://www.example.com/index.shtml
it would be referenced by:
https://www.example.com/cgi-bin/ssi/index.shtml

The pathinfo is appended to the server's working directory and passed
to ssi via the PATH_TRANSLATED environment variable. The thttpd
process removed any ".." sequences and decodes hex escapes before
passing the string to ssi. However, by treating the string in that
order, hex escaped ".." sequences (%2e%2e) escape the filter. This is
usually not a problem because the server process has additional checks
to prevent requests from referring to files outside of the web root.

ssi, on the other hand, has no such checks about which files it should
process. The pathname passed via PATH_TRANSLATED is used unaltered
in fopen(3). Therefore, URLs can be crafted to retrieve any files in
known locations on the web server:

https://www.example.com/cgi-bin/ssi/cgi-bin/ssi

https://www.example.com/cgi-bin/ssi/.htpasswd

https://www.example.com/cgi-bin/ssi/cgi-bin/random-cgi.pl

https://www.example.com/cgi-bin/ssi//%2e%2e/%2e%2e/<etc...>/etc/passwd

(The "//" is needed to fool expand_symlinks() in libhttpd.c)

3. Fix

Jef Poskanzer (the author of thttpd) has merged my patches into thttpd
2.20. Upgrading to 2.20 will prevent ssi from displaying CGI source
files, .htpasswd files, or files outside the web server root.

4. Availability

thttpd 2.20 is available at:
https://www.acme.com/software/thttpd/thttpd-2.20.tar.gz

This advisory (and others) will be posted at:
https://www.dopesquad.net/security

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    38 Files
  • 24
    Sep 24th
    65 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close