Affected system: PHPPHP5.2.0 unaffected system: PHPPHP5.2.1 description: BUGTRAQID: 23238PHP is a widely used target scripting language. it is especially suitable for Web development and can be embedded in HTML. PHP memory controller implementation vulnerability, local
Affected systems: PHP 5.2.0
Unaffected system: PHP 5.2.1
Description: bugtraq id: 23238
PHP is a widely used target scripting language. it is especially suitable for Web development and can be embedded into HTML. A vulnerability exists in the PHP memory controller implementation. local attackers may exploit this vulnerability to escalate permissions. If the memory is allocated through the emalloc () function, the new Zend memory controller in PHP will process this request in the internal _ zend_mm_alloc_int () function, first, use the ZEND_MM_TRUE_SIZE macro to determine the actual size of the requested memory block, as shown below:
static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ...) { size_t true_size, best_size = 0x7fffffff; zend_mm_free_block *p, *end, *best_fit = NULL; true_size = ZEND_MM_TRUE_SIZE(size); The macro expands to (((long)size<(long)ZEND_MM_MIN_SIZE)?(ZEND_MM_ALIGNED_MIN_HEADER_SIZE): (ZEND_MM_ALIGNED_SIZE(size ZEND_MM_ALIGNED_HEADER_SIZE END_MAGIC_SIZE)))
However, before the comparison, the size of this code is set to a long character type. Therefore, if you plead for a large memory block that will normally cause memory corruption or out-of-bounds, it is possible to process it as a negative number and allocate only a small memory block, resulting in multiple available buffer overflow.