Contact

Contact us

+49 241 510081-0
kontakt@redteam-pentesting.de
Contact form
RedTeam Pentesting HeaderRedTeam Pentesting HeaderRedTeam Pentesting HeaderRedTeam Pentesting HeaderRedTeam Pentesting HeaderRedTeam Pentesting HeaderRedTeam Pentesting HeaderRedTeam Pentesting Header

Pico Server (pServ) Information Disclosure Of CGI Sources

RedTeam found a Information Disclosure vulnerability in Pico Server (pServ) which gives an attacker the ability to read all files from cgi-bin.

Details

  • Product: Pico Server (pServ)
  • Affected Version: 3.2(verified), <=3.2 probably too
  • Immune Version: 3.3
  • OS affected: all
  • Security-Risk: medium
  • Remote-Exploit: yes
  • Vendor-URL: http://pserv.sourceforge.net/
  • Vendor-Status: new version available
  • Advisory-URL: https://www.redteam-pentesting.de/advisories/rt-sa-2005-011
  • Advisory-Status: published
  • CVE: CAN-2005-1366 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-1366)

Introduction

From https://pserv.sourceforge.net/:

Pico Server is a small web server. It is meant to be portable and configurable.

  • small, portable
  • fast
  • CGI-BIN support
  • auto-indexing of directories
  • access and error logging (see p-reporter for an analyzer)
  • forking or single-connection at choice

Pico Server (pServ) is written in portable C (K&R style so it can compile on older compilers too) and sports several options that by means of #define statements can customize the behavior, the performance and the feature set so to be able to fit better the the requisites.

Pserv does not correctly check whether a user accesses a file in cgi-bin and gives away the source instead of executing it.

More Details

pServ has CGI-BIN support. Only URLs beginning with “cgi-bin” are treated as cgi-scripts. pServ checks, whether a file is in cgi-bin by checking whether the beginning of the directory part of the url matches “cgi-bin”. A user can circumvent this by asking for /somedir/../cgi-bin/ and therefore is able to retrieve the complete sourcecode of all scripts in cgi-bin.

Proof of Concept

This url lets us download the source of test.pl instead of executing it:

http://vuln-host:2000/somedir/../cgi-bin/test.pl

Workaround

n/a

Fix

The Developers have released Version 3.3. This version should fix the problem. The changes have not been tested by RedTeam, yet.

Security Risk

The security risk is rated medium because a remote attacker can get source code that would otherwise not be available to him. This can help the attacker in further attacks. As many programmers put sensitive configuration parameters like database passwords in the source code this attack can be quite harmful.

History

  • 2005-04-29 found
  • 2005-05-02 first attempt to inform developers
  • 2005-05-02 CAN-number assigned
  • 2005-05-04 second attempt to inform developers
  • 2005-05-16 new version released. Advisory published.
  • 2009-05-08 Updated Advisory URL

RedTeam

RedTeam is a penetration testing group working at the Laboratory for Dependable Distributed Systems at RWTH-Aachen University. You can find more Information on the RedTeam Project at https://www.redteam-pentesting.de