Skip to content
OpenAdvisories
Critical · 9.4 Public exploit CVE-2023-3824 EUVD-2023-44452

Buffer overflow and overread in phar_dir_read()

Published Aug 11, 2023 · Updated Feb 13, 2025 · Assigned by php

Description

In PHP version 8.0.* before 8.0.30,  8.1.* before 8.1.22, and 8.2.* before 8.2.8, when loading phar file, while reading PHAR directory entries, insufficient length checking may lead to a stack buffer overflow, leading potentially to memory corruption or RCE.

Affected products

VendorProductAffectedFixed
PHP Group PHP 8.0.* – < 8.0.30, 8.1.* – < 8.1.22, 8.2.* – < 8.2.8 8.0.30

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 12 php8.2 8.2.18-1~deb12u1 DSA-5661-1
Debian 11 php7.4 7.4.33-1+deb11u5 DSA-5660-1
Debian 10 php7.3 7.3.31-1~deb10u5 DLA-3555-1
ReleasePackageFixed inAdvisory
Ubuntu 22.04 LTS php8.1 8.1.2-1ubuntu2.14 USN-6305-1
Ubuntu 20.04 LTS php7.4 7.4.3-4ubuntu2.20 USN-6305-2
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS php7.2 7.2.24-0ubuntu0.18.04.17+esm2 USN-6305-2
Ubuntu Pro 16.04 LTS php7.0 7.0.33-0ubuntu0.16.04.16+esm8 USN-6305-2
Ubuntu Pro 14.04 LTS php5 No fix yet —
ReleasePackageFixed inAdvisory
RHEL 9 apcu-panel +2 5.1.21-1.module+el9.1.0.z+15477+cb86791d RHSA-2024:0387
RHEL 9 php +23 8.0.30-1.el9_2 RHSA-2024:0387, RHSA-2023:5926
RHEL 9 php-pecl-rrd 2.0.3-4.module+el9.1.0.z+15477+cb86791d RHSA-2024:0387
RHEL 9 php-pecl-xdebug3 3.1.4-1.module+el9.1.0.z+15477+cb86791d RHSA-2024:0387
RHEL 9 php-pecl-zip 1.20.1-1.module+el9.1.0.z+15477+cb86791d RHSA-2024:0387
RHEL 8 apcu-panel +2 5.1.18-1.module+el8.10.0+22485+a3539972 RHSA-2024:10952, RHSA-2023:5927
RHEL 8 libzip +2 1.6.1-1.module+el8.10.0+22485+a3539972 RHSA-2024:10952, RHSA-2023:5927
RHEL 8 php +25 7.4.33-2.module+el8.10.0+22485+a3539972 RHSA-2024:10952, RHSA-2023:5927
RHEL 8 php-pear 1:1.10.13-1.module+el8.6.0+13671+84712317 RHSA-2024:10952, RHSA-2023:5927
RHEL 8 php-pecl-rrd 2.0.1-1.module+el8.10.0+22485+a3539972 RHSA-2024:10952, RHSA-2023:5927
RHEL 8 php-pecl-xdebug 2.9.5-1.module+el8.10.0+22485+a3539972 RHSA-2024:10952
RHEL 8 php-pecl-xdebug3 3.1.2-1.module+el8.6.0+13671+84712317 RHSA-2023:5927
RHEL 8 php-pecl-zip 1.18.2-1.module+el8.10.0+22485+a3539972 RHSA-2024:10952, RHSA-2023:5927

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 apcu-panel +2 5.1.21-1.module_el9.1.0+15+94ba28e4 ALSA-2024:0387
AlmaLinux 9 php +23 8.0.30-1.el9_2 ALSA-2024:0387, ALSA-2023:5926
AlmaLinux 9 php-pecl-rrd 2.0.3-4.module_el9.1.0+15+94ba28e4 ALSA-2024:0387
AlmaLinux 9 php-pecl-xdebug3 3.1.4-1.module_el9.1.0+15+94ba28e4 ALSA-2024:0387
AlmaLinux 9 php-pecl-zip 1.20.1-1.module_el9.1.0+15+94ba28e4 ALSA-2024:0387
AlmaLinux 8 apcu-panel +2 5.1.18-1.module_el8.6.0+2750+78feabcb ALSA-2024:10952, ALSA-2023:5927
AlmaLinux 8 libzip +1 1.6.1-1.module_el8.6.0+2750+78feabcb ALSA-2024:10952, ALSA-2023:5927
AlmaLinux 8 libzip-devel 1.6.1-1.module_el8.6.0+3239+bedf0508 ALSA-2024:10952, ALSA-2023:5927
AlmaLinux 8 php +25 7.4.33-2.module_el8.10.0+3935+28808425 ALSA-2024:10952, ALSA-2023:5927
AlmaLinux 8 php-pear 1:1.10.13-1.module_el8.6.0+2739+efabdb8f ALSA-2024:10952, ALSA-2023:5927
AlmaLinux 8 php-pecl-rrd 2.0.1-1.module_el8.3.0+2009+b272fdef ALSA-2024:10952, ALSA-2023:5927
AlmaLinux 8 php-pecl-xdebug 2.9.5-1.module_el8.6.0+2750+78feabcb ALSA-2024:10952
AlmaLinux 8 php-pecl-xdebug3 3.1.2-1.module_el8.6.0+2739+efabdb8f ALSA-2023:5927
AlmaLinux 8 php-pecl-zip 1.18.2-1.module_el8.6.0+2750+78feabcb ALSA-2024:10952, ALSA-2023:5927

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 php 8.0.30-1.el9_2 RLSA-2023:5926
Rocky Linux 9 php-pecl-apcu 5.1.21-1.module+el9.6.0+32040+1f1dedb8 RLSA-2024:0387
Rocky Linux 9 php-pecl-rrd 2.0.3-4.module+el9.6.0+32040+1f1dedb8 RLSA-2024:0387
Rocky Linux 9 php-pecl-xdebug3 3.1.4-1.module+el9.6.0+32040+1f1dedb8 RLSA-2024:0387
Rocky Linux 9 php-pecl-zip 1.20.1-1.module+el9.6.0+32040+1f1dedb8 RLSA-2024:0387
Rocky Linux 8 libzip 1.6.1-1.module+el8.10.0+1604+6558efc7 RLSA-2024:10952, RLSA-2023:5927
Rocky Linux 8 php 7.4.33-2.module+el8.10.0+1912+72767185 RLSA-2024:10952, RLSA-2023:5927
Rocky Linux 8 php-pear 1:1.10.13-1.module+el8.7.0+1067+0a7071cc RLSA-2024:10952, RLSA-2023:5927
Rocky Linux 8 php-pecl-apcu 5.1.18-1.module+el8.10.0+1604+6558efc7 RLSA-2024:10952, RLSA-2023:5927
Rocky Linux 8 php-pecl-rrd 2.0.1-1.module+el8.10.0+1604+6558efc7 RLSA-2024:10952, RLSA-2023:5927
Rocky Linux 8 php-pecl-xdebug 2.9.5-1.module+el8.10.0+1604+6558efc7 RLSA-2024:10952
Rocky Linux 8 php-pecl-xdebug3 3.1.2-1.module+el8.6.0+790+fc63e43f RLSA-2023:5927
Rocky Linux 8 php-pecl-zip 1.18.2-1.module+el8.10.0+1604+6558efc7 RLSA-2024:10952, RLSA-2023:5927
ReleasePackageFixed inAdvisory
SLES 15 SP5 php7 +4 7.4.33-150400.4.28.1 SUSE-SU-2023:3541-1
SLES 15 SP5 php8 +5 8.0.30-150400.4.37.1 SUSE-SU-2023:3528-1
SLES 15 SP4 php7 +4 7.4.33-150400.4.28.1 SUSE-SU-2023:3541-1
SLES 15 SP4 php8 +5 8.0.30-150400.4.37.1 SUSE-SU-2023:3528-1
SLES 15 SP3 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SLES 15 SP2 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SLES 12 SP5 php74 7.4.33-1.62.1 SUSE-SU-2023:3445-1
Show 8 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLES 12 php74 7.4.33-1.62.1 SUSE-SU-2023:3445-1
SLES for SAP 15 SP3 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SLES for SAP 15 SP2 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SLE HPC 15 SP3 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SLE HPC 15 SP2 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SUSE Manager Server 4.2 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SUSE Enterprise Storage 7.1 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
SUSE Enterprise Storage 7 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3498-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed php8 8.2.9-1.1 openSUSE-SU-2024:13153-1
openSUSE Leap 15.5 php7 +5 7.4.33-150400.4.28.1 SUSE-SU-2023:3541-1
openSUSE Leap 15.5 php8 +5 8.0.30-150400.4.37.1 SUSE-SU-2023:3528-1
openSUSE Leap 15.4 php7 7.4.33-150200.3.60.1 SUSE-SU-2023:3541-1, SUSE-SU-2023:3498-1
openSUSE Leap 15.4 php7-fpm +4 7.4.33-150400.4.28.1 SUSE-SU-2023:3541-1
openSUSE Leap 15.4 php8 +5 8.0.30-150400.4.37.1 SUSE-SU-2023:3528-1
ReleasePackageFixed inAdvisory
Alpine v3.17 php81 8.1.22-r0 —
Alpine v3.16 php8 8.0.30-r0 —
Alpine v3.16 php81 8.1.22-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 php8.1 +25 8.1.22-1.amzn2023.0.1 ALAS2023-2023-325
Amazon Linux 2023 php8.2 +25 8.2.9-1.amzn2023.0.2 ALAS2023-2023-324
Amazon Linux 2 php +23 5.4.16-46.amzn2.0.6 ALAS2-2025-2832

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 php 8.2.8-1 —
Azure Linux 2 (CBL-Mariner) php 8.1.22-1 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 apcu-panel +2 5.1.21-1.module+el9.1.0+20776+c1b960c0 ELSA-2024-0387
Oracle Linux 9 php +23 8.0.30-1.el9_2 ELSA-2024-0387, ELSA-2023-5926
Oracle Linux 9 php-pecl-rrd 2.0.3-4.module+el9.1.0+20776+c1b960c0 ELSA-2024-0387
Oracle Linux 9 php-pecl-xdebug3 3.1.4-1.module+el9.1.0+20776+c1b960c0 ELSA-2024-0387
Oracle Linux 9 php-pecl-zip 1.20.1-1.module+el9.1.0+20776+c1b960c0 ELSA-2024-0387
Oracle Linux 8 apcu-panel +2 5.1.18-1.module+el8.10.0+90472+f810484b ELSA-2024-10952, ELSA-2023-5927
Oracle Linux 8 libzip +2 1.6.1-1.module+el8.10.0+90472+f810484b ELSA-2024-10952, ELSA-2023-5927
Oracle Linux 8 php +25 7.4.33-2.module+el8.10.0+90472+f810484b ELSA-2024-10952, ELSA-2023-5927
Oracle Linux 8 php-pear 1:1.10.13-1.module+el8.6.0+20568+84712317 ELSA-2024-10952, ELSA-2023-5927
Oracle Linux 8 php-pecl-rrd 2.0.1-1.module+el8.10.0+90472+f810484b ELSA-2024-10952, ELSA-2023-5927
Oracle Linux 8 php-pecl-xdebug 2.9.5-1.module+el8.10.0+90472+f810484b ELSA-2024-10952
Oracle Linux 8 php-pecl-xdebug3 3.1.2-1.module+el8.6.0+20568+84712317 ELSA-2023-5927
Oracle Linux 8 php-pecl-zip 1.18.2-1.module+el8.10.0+90472+f810484b ELSA-2024-10952, ELSA-2023-5927

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 3 repositories

  • jhonnybonny/CVE-2023-3824 ★ 3 · Mar 18, 2024

    Vulnerability in PHP Phar files, due to buffer overflow, arises from insufficient length checks on file names within the Phar archive. Malicious actors can craft Phar files with long file names, lead…

  • dadosneurais/cve-2023-3824 ★ 0 · Sep 23, 2025
  • bluefish3r/poc-cve ★ 0 · Jan 11, 2025

    poc-cve-2023-3824

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Advisories 32

References