Closed
Description
Description
The following code:
no need php code
Resulted in this output:
==1891326==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000085d7ec0 at pc 0x000000623708 bp 0x7fff6a64c320 sp 0x7fff6a64baa0
READ of size 33 at 0x0000085d7ec0 thread T0
#0 0x623707 in printf_common(void*, char const*, __va_list_tag*) (/home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php+0x623707)
#1 0x7efd7cabdbe5 in zend_accel_error_va_args /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/zend_accelerator_debug.c:79:3
#2 0x7efd7cabc7de in zend_accel_error /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/zend_accelerator_debug.c:103:2
#3 0x7efd7cd28095 in accel_post_startup /home/phpfuzz/WorkSpace/flowfusion/php-src/ext/opcache/ZendAccelerator.c:3334:3
#4 0x4d33854 in zend_post_startup /home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend.c:1105:7
#5 0x354ec4f in php_module_startup /home/phpfuzz/WorkSpace/flowfusion/php-src/main/main.c:2326:6
#6 0x4d60378 in php_cli_startup /home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php_cli.c:397:9
#7 0x4d56199 in main /home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php_cli.c:1280:6
#8 0x7efd8469ad8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
#9 0x7efd8469ae3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
#10 0x605934 in _start (/home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php+0x605934)
0x0000085d7ec0 is located 32 bytes to the left of global variable 'main_cwd_state' defined in '/home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_virtual_cwd.c:92:18' (0x85d7ee0) of size 16
0x0000085d7ec0 is located 0 bytes to the right of global variable 'zend_system_id' defined in '/home/phpfuzz/WorkSpace/flowfusion/php-src/Zend/zend_system_id.c:24:15' (0x85d7ea0) of size 32
SUMMARY: AddressSanitizer: global-buffer-overflow (/home/phpfuzz/WorkSpace/flowfusion/php-src/sapi/cli/php+0x623707) in printf_common(void*, char const*, __va_list_tag*)
Shadow bytes around the buggy address:
0x0000810b2f80: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000810b2f90: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000810b2fa0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
0x0000810b2fb0: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
0x0000810b2fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9
=>0x0000810b2fd0: f9 f9 f9 f9 00 00 00 00[f9]f9 f9 f9 00 00 f9 f9
0x0000810b2fe0: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
0x0000810b2ff0: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
0x0000810b3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0000810b3010: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
0x0000810b3020: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==1891326==ABORTING
To reproduce:
./php-src/sapi/cli/php -d "zend_extension=/home/phpfuzz/WorkSpace/flowfusion/php-src/modules/opcache.so" -d "opcache.enable_cli=1" -d "opcache.file_cache="/test"" -d "opcache.log_verbosity_level=4"
PHP Version
nightly
Operating System
ubuntu 22.04