J-Security Center

Title: Directory Pro Arbitrary File Disclosure Vulnerability

Severity: HIGH

Description:

Webdirectory Pro is a web application used to create a searchable directory of links developed by Cosmicperl.

Webdirectory Pro contains an input validation vulnerability which may lead to disclosure of sensitive information to attackers.

The vulnerability exists when the 'directorypro.cgi' script, written in perl, attempts to open a file with a filename based on user input. The filename is constructed using a client-supplied form variable called 'show', which is prepended by path information and appended with the appropriate extension before being passed to open().

Unfortunately it is possible to force the misinterpretation of the filename if a NULL byte is inserted into the variable. While perl ignores NULL bytes, the underlying system calls which are used by open() use NULL bytes to terminate strings. A NULL byte can be inserted into the value of the 'show' variable, which will cause the filename to be 'terminated' prematurely (the extension appdended will be 'cut off') when the filename is passed to the actual system call.

Therefore, by using "../" sequences to traverse up directories in the filesystem and terminating with a NULL byte, it is possible to have directorypro.cgi open an arbitrary webserver-readable file on the filesystem. The contents of this file are then output to the client.

Affected Products:

  • Cosmicperl Directory Pro 2.0.0

References:

Juniper Networks provides this content via a wide variety of sources and production methods. If notified of errors or omissions in the content of this page, Juniper Networks, at its discretion, will modify or remove the page or leave the content as is, depending on various factors including but not limited to the reputation and authority of the party providing the notification. Please use the contact information displayed elsewhere on this page to report any errors or omissions regarding the content on this page.