CVE-2009-3558 in PHPinfo

Summary

by MITRE

The posix_mkfifo function in ext/posix/posix.c in PHP before 5.2.12 and 5.3.x before 5.3.1 allows context-dependent attackers to bypass open_basedir restrictions, and create FIFO files, via the pathname and mode arguments, as demonstrated by creating a .htaccess file.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 08/28/2021

The vulnerability described in CVE-2009-3558 represents a critical security flaw in PHP's posix_mkfifo function that enables attackers to circumvent important security restrictions. This issue affects PHP versions prior to 5.2.12 and 5.3.1, making it a significant concern for web applications running on affected versions. The vulnerability specifically targets the open_basedir restriction mechanism, which is designed to limit file access to specific directories, thereby preventing unauthorized file operations that could compromise system integrity.

The technical implementation of this vulnerability stems from improper validation of pathname and mode arguments within the posix_mkfifo function. When attackers exploit this flaw, they can create FIFO (First In, First Out) named pipes in directories outside the configured open_basedir restrictions. This bypass occurs because the function does not adequately verify the target directory path against the security boundaries established by open_basedir. The vulnerability becomes particularly dangerous when combined with the ability to create files in sensitive locations such as web server directories, where attackers can potentially create malicious .htaccess files that alter server behavior and permissions.

The operational impact of this vulnerability extends beyond simple file creation, as it allows attackers to manipulate the web server environment in ways that could lead to complete system compromise. By creating FIFO files in web-accessible directories, attackers can potentially execute arbitrary code or manipulate server configurations through the .htaccess file creation capability. This represents a privilege escalation vector that transforms a simple file creation vulnerability into a potential full system compromise. The ATT&CK framework categorizes this as a privilege escalation technique through file system manipulation, while CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) directly applies to the underlying path traversal flaw.

Security mitigations for this vulnerability involve immediate patching of affected PHP installations to versions 5.2.12 or 5.3.1 and later, which contain the necessary fixes to properly validate pathname arguments against open_basedir restrictions. System administrators should also implement additional monitoring for unauthorized file creation activities in web directories and consider implementing additional security controls such as SELinux policies or AppArmor profiles to provide defense-in-depth. The vulnerability demonstrates the importance of proper input validation in system call interfaces and highlights how seemingly benign functions can become attack vectors when security boundaries are not properly enforced. Organizations should conduct comprehensive vulnerability assessments to identify all PHP installations that may be affected and ensure proper security hardening practices are implemented across their web server environments.

Reservation

10/05/2009

Disclosure

11/23/2009

Moderation

accepted

Entry

VDB-50876

CPE

ready

EPSS

0.02081

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!