VulnWatch by ve1ve2
high 8.2 EPSS 1.61%

GHSA-r977-prxv-hc43 / CVE-2024-11233: Single byte overread with convert.quoted-printable-decode filter

Source:
PHP releases (GitHub php/php-src tags)
Published:
Fetched:
Updated:
Affects:
php php-src

https://github.com/php/php-src/security/advisories/GHSA-r977-prxv-hc43 ↗

repo-advisoryCWE-122securityrepo:php/php-srcstack

Single byte overread with convert.quoted-printable-decode filter ### Summary A memory-related vulnerability in PHP’s filter handling system, particularly when processing input with convert.quoted-printable-decode filters, leads to a segmentation fault. This vulnerability is triggered through specific sequences of input data, causing PHP to crash. When exploited, it allows an attacker to extract a single byte of data from the heap or cause a DoS. ### Details The issue is caused by a missing bound check. The crash is reliably detected by AddressSanitizer (ASAN), which reports a segmentation fault caused by a read memory access violation. This suggests that there may be an out-of-bounds read or a use-after-free condition in the affected filters. Below is an example stack trace as detected by ASAN: ``` AddressSanitizer: SEGV on unknown address 0x7ffff4200000 (pc 0x55555635d5b4 bp 0x000000000001 sp 0x7fffffff9e20 T0) The signal is caused by a READ memory access. #0 0x55555635d5b4 in php_conv_qprint_decode_convert (/php-8.3.13/sapi/cli/php+0xf5d5b4) #1 0x555556355e00 in strfilter_convert_append_bucket (/php-8.3.13/sapi/cli/php+0xf55e00) #2 0x55555635507d in strfilter_convert_filter (/php-8.3.13/sapi/cli/php+0xf5507d) ... ``` ### PoC 1. Set to not detect leaks `export ASAN_OPTIONS=detect_leaks=0` 2. Run the following with the 2 attached files against php compiled with ASAN in [php_crash.zip](https://github.com/user-attachments/files/17654396/php_crash.zip) `cat ./php_crash | ./sapi/cli/php poc.php` 3. Note the ASAN trace once the final output his the echo implode ``` root@32fbd16f3ed1:/php-8.3.13# cat php_crash | ./sapi/cli/php zlib_fuzz.php Warning: file_get_contents(): Unable to locate filter "bzip2.compress" in /php-8.3.13/zlib_fuzz.php on line 25 Warning: file_get_contents(): Unable to create filter (bzip2.compress) in /php-8.3.13/zlib_fuzz.php on line 25 Warning: file_get_contents(): Unable to locate filter "bzip2.decompress" in /php-8.3.13/zlib_fuzz.php on line 25 Warning: file_get_contents(): Unable to create filter (bzip2.decompress) in /php-8.3.13/zlib_fuzz.php on line 25 AddressSanitizer:DEADLYSIGNAL ================================================================= ==1558930==ERROR: AddressSanitizer: SEGV on unknown address 0x7ffff4200000 (pc 0x55555635d5b4 bp 0x000000000001 sp 0x7fffffff9e40 T0) ==1558930==The signal is caused by a READ memory access. #0 0x55555635d5b4 in php_conv_qprint_decode_convert /php-8.3.13/ext/standard/filters.c:999:46 #1 0x555556355e00 in strfilter_convert_append_bucket /php-8.3.13/ext/standard/filters.c #2 0x55555635507d in strfilter_convert_filter /php-8.3.13/ext/standard/filters.c:1525:7 #3 0x5555563f7b0f in _php_stream_fill_read_buffer /php-8.3.13/main/streams/streams.c:583:14 #4 0x5555563f942e in _php_stream_read /php-8.3.13/main/streams/streams.c:747:8 #5 0x555556400a9c in _php_stream_copy_to_mem /php-8.3.13/main/streams/streams.c:1580:16 #6 0x5555561ced5e in zif_file_get_contents /php-8.3.13 Patched: 8.1.31, 8.2.26, 8.3.14

Linked vulnerabilities (2)

CVE-2024-11233 high 8.2 EPSS 1.61% (p76) NVDCVE.orgGHSA
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

php8.2 - security update

CWE: CWE-122Aliases: CVE-2024-11234, CVE-2024-11236, CVE-2024-8929, CVE-2024-8932, GHSA-r977-prxv-hc43
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L

Single byte overread with convert.quoted-printable-decode filter

CWE: CWE-122Aliases: CVE-2024-11233