CVE-2023-3824CWE-119

Buffer overflow and overread in phar_dir_read()

Critical · published August 11, 2023

CVSS v3.1
9.4
EPSS
22%
Percentile
97.6
In the wild
Unconfirmed
What it is

🚨 An insufficient length check while loading PHAR files in PHP is a gateway to potential remote code execution! 🔥 Think of this as a librarian who fails to check the dimensions of books before shelving them—imagine a gigantic tome squeezing into a tiny space and causing the whole row to collapse! 📚 If exploited, this vulnerability could lead to devastating memory corruption or even remote code execution, giving attackers the keys to your server's kingdom. An attacker could craft a malicious PHAR file that, once processed, could execute any code they desire—talk about a horror story!

Put simply

Think of this as a librarian who fails to check the dimensions of books before shelving them—imagine a gigantic tome squeezing into a tiny space and causing the whole row to collapse! 📚 This vulnerability arises from a stack buffer overflow due to insufficient length checking when reading PHAR directory entries in PHP versions 8.0.* before 8.0.30, 8.1.* before 8.1.22, and 8.2.* before 8.2.8, leading to potential memory corruption or remote code execution.

What to do

If exploited, this vulnerability could lead to devastating memory corruption or even remote code execution, giving attackers the keys to your server's kingdom. An attacker could craft a malicious PHAR file that, once processed, could execute any code they desire—talk about a horror story! To safeguard your applications, upgrade PHP to version 8.0.30, 8.1.22, or 8.2.8 immediately. Regularly audit your code for proper input validation and consider using safer alternatives for file handling. You've got this! By following these steps, you’ll lock down your PHP environment and keep it safe from harm! 🛡️

The record
Technical detail
CVSS v3.1
9.4 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
CVSS v4.0
Not supplied
EPSS
0.21786 · 97.6th percentile
Weakness
CWE-119 · Improper Restriction of Operations within the Bounds of a Memory Buffer
Published
2023-08-11T05:48Z
EPSS history
Timeline
  • 11 AUG 05:48Z
    Buffer overflow and overread in phar_dir_read()
    cvelistv5