CVE-2023-3824: Stack Buffer Overflow in PHP PHAR Directory Parsing
- Vendors
- Debian ProjectFedora ProjectPHP Group
CVE-2023-3824 is a stack-based buffer overflow in PHP's phar_dir_read() function. Improper filename-length checking and NUL termination while reading specially crafted PHAR directory entries cause an out-of-bounds write and a subsequent buffer overread. Affected upstream releases include PHP 8.0.x before 8.0.30, 8.1.x before 8.1.22, and 8.2.x before 8.2.8. Processing a malicious archive can disclose uninitialized stack data and corrupt memory, potentially enabling arbitrary code execution. Proof-of-concept behavior demonstrates information disclosure and a buffer overwrite; code execution remains application-dependent and is not demonstrated by that proof of concept.
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 can expose uninitialized stack memory, corrupt process memory, and potentially crash the affected PHP process. Further exploitation may permit arbitrary code execution with the PHP process's privileges, compromising the confidentiality and integrity of data accessible to that process. Reliable code execution depends on the application and runtime environment and is not established by the demonstrated buffer overwrite alone.
Mitigation
If you can’t patch tonight, do this now.
Until patched, prevent applications from inspecting or enumerating untrusted PHAR archives, and restrict workflows that allow attacker-controlled archives to reach PHAR directory-reading operations. These measures reduce exposure to the vulnerable code path but are not a substitute for updating PHP; no formal upstream workaround is specified.
Remediation
Patch, then assume compromise.
Upgrade PHP to a currently supported release containing the fix. The first fixed releases in the affected upstream branches are PHP 8.0.30, 8.1.22, and 8.2.8. For vendor-maintained packages or products embedding PHP, install the applicable vendor security update, since backported fixes may retain older upstream version numbers. Echo php-7.2 packages have a specified fixed version of 7.2.34+e1 or later.
Exploits
1 exploit validated by Mallory's analysis. Hidden: 3 rejected by Mallory's analysis as not a working exploit.
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-2023-3824 exploited in the wild?
- Yes. As of Dec 2, 2026, Mallory has reports of exploitation in the wild.
- Is there a public exploit for CVE-2023-3824?
- Yes. Mallory tracks 1 public exploit or proof of concept for CVE-2023-3824, the earliest disclosed Sep 23, 2025.
- Is there a patch for CVE-2023-3824?
- Upgrade PHP to a currently supported release containing the fix. The first fixed releases in the affected upstream branches are PHP 8.0.30, 8.1.22, and 8.2.8.
- What products are affected by CVE-2023-3824?
- PHP Group Php, Debian Project Debian Linux, and Fedora Project Fedora.
- How severe is CVE-2023-3824?
- CVE-2023-3824 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 21.8% (98th percentile) as of Dec 2, 2026.
Recent activity
12 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.