Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Bugtraq
[Top] [All Lists]

Re: Squirrelmail local file inclusion

Subject: Re: Squirrelmail local file inclusion
Date: Thu, 01 Jun 2006 23:21:01 -0500
--On June 1, 2006 12:50:15 AM +0000 brokejunker@yahoo.com wrote:

Squirrelmail local file inclusion bug in functions/plugin.php .
Tested on the latest 1.4.x version.
No authentication needed.

if (isset($plugins) && is_array($plugins)) {
    foreach ($plugins as $name) {
        use_plugin($name);
    }
...
function use_plugin ($name) {
    if (file_exists(SM_PATH . "plugins/$name/setup.php")) {
        include_once(SM_PATH . "plugins/$name/setup.php");
        $function = "squirrelmail_plugin_init_$name";
        if (function_exists($function)) {
            $function();
        }
    }
}
....

If register_globals is on we can control the $name variable.

This is the second "bug" I've seen in the past week that requires register_globals to be on. Yet register_globals has been off by default for the past four years. <http://us2.php.net/ChangeLog-4.php#4.2.0>

The developers of PHP specifically address its use and warn against it unless you know what you're doing. <http://us2.php.net/register_globals>

Squirrelmail even warns specifically against using register_globals = on and checks for it when installing.

grep register_globals /usr/local/share/doc/squirrelmail/*
/usr/local/share/doc/squirrelmail/ChangeLog: - Added PHP register_globals check to configuration test utility.
/usr/local/share/doc/squirrelmail/ChangeLog: - Fixed use of squirrelmail_language cookie with PHP register_globals =
/usr/local/share/doc/squirrelmail/ChangeLog: - Prefs caching didn't work properly with register_globals off (#995102).
/usr/local/share/doc/squirrelmail/ChangeLog: by register_globals = off.
/usr/local/share/doc/squirrelmail/ChangeLog: - This release is compatible with installations that have register_globals set to off.
/usr/local/share/doc/squirrelmail/INSTALL: It is highly advised to NOT turn on register_globals, as this can lead
/usr/local/share/doc/squirrelmail/INSTALL: to security holes. If you must use register_globals for some applications,
/usr/local/share/doc/squirrelmail/security.txt:- PHP configuration. It's very important to turn register_globals OFF.
/usr/local/share/doc/squirrelmail/security.txt: could only be exploited when register_globals was set to on. If you
/usr/local/share/doc/squirrelmail/security.txt: need register_globals for other web applications, turn it on specifically


Yet know we're getting "security advisories" warning, hey, if you change the defaults and ignore all the warnings, you too can write insecure code!

Is human stupidity a software bug?

Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/

Attachment: p7s7E7Ob3fTgZ.p7s
Description: S/MIME cryptographic signature

<Prev in Thread] Current Thread [Next in Thread>