PHP memory controller symbol compared to multiple overflow vulnerabilities

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.