PHP Str_Replace()整数溢出漏洞

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

PHP是一款广泛使用的WEB开发脚本语言。 PHP str_replace()内存分配存在整数溢出,远程攻击者可利用此漏洞以应用程序进程权限执行任意指令。 当str_replace()调用后,代码会根据搜索路径长度切换到两个不同代码路径。单个字符搜索字符串会又不同函数处理,因为这可导致效率更高。有效方法部分代码如下: Z_STRLEN_P(result) = len + (char_count * (to_len - 1)); Z_STRVAL_P(result) = target = emalloc(Z_STRLEN_P(result) + 1); Z_TYPE_P(result) = IS_STRING; 很显然当char_count和to_len超过65537字节时会导致32位长度计数期整数溢出,在emalloc()调用处理时分配不够内存,在之后的替代操作时可溢出缓冲区。 PHP PHP 5.1.6 PHP PHP 5.1.5 PHP PHP 5.1.4 PHP PHP 5.1.3 PHP PHP 5.1.3 PHP PHP 5.1.2 PHP PHP 5.1.1 PHP PHP 5.1 PHP PHP 5.0.5 PHP PHP 5.0.4 PHP PHP 5.0.3 + Trustix Secure Linux 2.2 PHP PHP 5.0.2 PHP PHP 5.0.1 PHP PHP 5.0 candidate 3 PHP PHP 5.0 candidate 2 PHP PHP 5.0 candidate 1 PHP PHP 5.0 .0 PHP PHP 4.4.4 PHP PHP 4.4.3 PHP PHP 4.4.2 PHP PHP 4.4.1 PHP PHP 4.4 .0 PHP PHP 4.3.11 PHP PHP 4.3.10 + Gentoo Linux + RedHat Fedora Core3 + Trustix Secure Enterprise Linux 2.0 + Trustix Secure Linux 2.2 + Trustix Secure Linux 2.1 + Trustix Secure Linux 2.0 + Trustix Secure Linux 1.5 PHP PHP 4.3.9 PHP PHP...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息