FreeBSD Ports Security Advisory: FreeBSD-SA-00:74.php

FreeBSD Security Advisories security-advisories at
Mon Nov 20 13:31:00 PST 2000


FreeBSD-SA-00:75                                           Security Advisory
                                                                FreeBSD, Inc.

Topic:          mod_php3/mod_php4 allows remote code execution

Category:       ports
Module:         mod_php3/mod_php4
Announced:      2000-11-20
Credits:        Jouko Pynnönen <jouko at SOLUTIONS.FI>
Affects:        Ports collection prior to the correction date.
Corrected:      2000-10-12 (mod_php4), 2000-10-18 (mod_php3)
Vendor status:  Updated version released
FreeBSD only:   NO

I.   Background

php is a commonly used HTML-embedded scripting language.

II.  Problem Description

The mod_php ports, versions prior to 3.0.17 (mod_php3) and 4.0.3
(mod_php4), contain a potential vulnerablilty that may allow a
malicious remote user to execute arbitrary code as the user running
the web server, typically user 'nobody'.  The vulnerability is due to
a format string vulnerability in the error logging routines.

A web server is vulnerable if error logging is enabled in php.ini.
Additionally, individual php scripts may cause the web server to be
vulnerable if the script uses the syslog() php function regardless of
error logging in php.ini.

The mod_php ports are not installed by default, nor are they "part of
FreeBSD" as such: it is part of the FreeBSD ports collection, which
contains over 4100 third-party applications in a ready-to-install
format.  The ports collections shipped with FreeBSD 3.5.1 and 4.1.1
contain this problem since it was discovered after the releases, but
it was corrected prior to the release of FreeBSD 4.2.

FreeBSD makes no claim about the security of these third-party
applications, although an effort is underway to provide a security
audit of the most security-critical ports.

III. Impact

Malicious remote users can execute arbitrary code on the local system
as the user running the webserver (typically user 'nobody').  This
vulnerability requires error logging to be enabled in php.ini or by
using the syslog() php function in a script.

If you have not chosen to install the mod_php3 or mod_php4
port/package, then your system is not vulnerable to this problem.

IV.  Workaround

Deinstall the mod_php3/mod_php4 port/package, if you you have
installed it.

V.   Solution

One of the following:

1) Upgrade your entire ports collection and rebuild the
mod_php3/mod_php4 port.

2) Deinstall the old package and install a new package dated after the
correction date, obtained from:



3) download a new port skeleton for the mod_php3/mod_php4 port from:

and use it to rebuild the port.

4) Use the portcheckout utility to automate option (3) above. The
portcheckout port is available in /usr/ports/devel/portcheckout or the
package can be obtained from:

Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see


This is the moderated mailing list freebsd-announce.
The list contains announcements of new FreeBSD capabilities,
important events and project milestones.
See also the FreeBSD Web pages at

To Unsubscribe: send mail to majordomo at
with "unsubscribe freebsd-announce" in the body of the message

More information about the freebsd-announce mailing list