CVE-2007-4850: Safe_mode and open_basedir Bypass in PHP libcurl (file:// with null byte)
- Vendor
- PHP Group
A vulnerability in curl/interface.c in the cURL library (libcurl) as used in PHP 5.2.4 and 5.2.5 allows attackers to bypass safe_mode and open_basedir restrictions. By crafting a file:// request containing a null byte (\x00), an attacker can read arbitrary files, circumventing the intended security controls. This is distinct from CVE-2006-2563.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Attackers can read arbitrary files on the server, bypassing PHP's safe_mode and open_basedir restrictions. This can lead to exposure of sensitive information, such as configuration files, credentials, or application source code, depending on the server's file system and permissions.
Mitigation
If you can’t patch tonight, do this now.
If immediate upgrade is not possible, disable use of file:// wrappers in PHP or restrict access to the cURL extension. Additionally, use operating system-level access controls to limit file read permissions for the PHP process.
Remediation
Patch, then assume compromise.
Upgrade to a version of PHP where this vulnerability is patched. Ensure that libcurl and PHP are both updated to versions that properly handle null byte injection in file:// requests and enforce safe_mode and open_basedir restrictions.
Exploits
No validated public exploits yet. Hidden: 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2007-4850 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2007-4850 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2007-4850?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2007-4850.
- Is there a patch for CVE-2007-4850?
- Upgrade to a version of PHP where this vulnerability is patched. Ensure that libcurl and PHP are both updated to versions that properly handle null byte injection in file:// requests and enforce safe_mode and open_basedir restrictions.
- What products are affected by CVE-2007-4850?
- PHP Group Php.
- How severe is CVE-2007-4850?
- CVE-2007-4850 has a CVSS v2 score of 5.0 (Medium) and an EPSS score of 5.6% (93rd percentile) as of Oct 16, 2026.
Recent activity
No public activity tracked yet. Mallory keeps watching.
No public activity observed for this vulnerability.