CVE-2004-1018: Integer Handling Errors in PHP <4.3.10 (shmop_write, pack, unpack)
- Vendors
- PHP GroupCanonical
Multiple integer handling errors exist in PHP versions prior to 4.3.10. Specifically, the shmop_write function is vulnerable to negative offset values, and both the pack and unpack functions are susceptible to integer overflows and underflows. These flaws can allow attackers to bypass safe mode restrictions, cause denial of service, or potentially execute arbitrary code.
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.
Successful exploitation may allow attackers to bypass PHP safe mode restrictions, leading to unauthorized access or modification of data. Additionally, attackers could cause denial of service conditions or execute arbitrary code, depending on the context in which the vulnerable functions are used.
Mitigation
If you can’t patch tonight, do this now.
If immediate upgrade is not possible, restrict access to scripts using shmop_write, pack, or unpack, and validate all input parameters to these functions to ensure they do not contain negative or excessively large values that could trigger integer overflows or underflows.
Remediation
Patch, then assume compromise.
Upgrade to PHP version 4.3.10 or later, where these integer handling errors have been addressed. Ensure that all code using shmop_write, pack, or unpack is reviewed for unsafe input handling.
Exploits
No validated public exploits yet. Hidden: 2 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-2004-1018 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2004-1018 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2004-1018?
- As of Oct 16, 2026, Mallory has not confirmed a public exploit for CVE-2004-1018. 2 candidate exploit records are not yet analyzed.
- Is there a patch for CVE-2004-1018?
- Upgrade to PHP version 4.3.10 or later, where these integer handling errors have been addressed. Ensure that all code using shmop_write, pack, or unpack is reviewed for unsafe input handling.
- What products are affected by CVE-2004-1018?
- PHP Group Php and Canonical Ubuntu Linux.
- How severe is CVE-2004-1018?
- CVE-2004-1018 has a CVSS v2 score of 10.0 (Critical) and an EPSS score of 16.2% (97th percentile) as of Oct 16, 2026.
Recent activity
No public activity tracked yet. Mallory keeps watching.
No public activity observed for this vulnerability.