Php gd Extension 'imagepstext () 'function Stack Buffer Overflow Vulnerability

Source: Internet
Author: User

Release date:
Updated on:

Affected Systems:
PHP 5.3.3
PHP 5.3.2
PHP 5.3.1
PHP 5.3
Unaffected system:
PHP 5.3.4
Bugtraq id: 45338

PHP is a widely used scripting language. It is especially suitable for Web development and can be embedded into HTML.

PHP implementation has a vulnerability. Attackers can exploit this vulnerability to execute arbitrary machine code in the PHP process, resulting in Web server crash and DoS attacks.

This vulnerability occurs because the application fails to perform sufficient boundary checks on user input. In versions earlier than 5.3.4, php gd extension does not correctly verify the number of anti-aliasing steps passed to the imagepstext function. The value must be 4 or 16. To hold these values, the 16-digit array aa is located in the stack. Fill the array before the verification step is completed, which will cause stack-based buffer overflow.

<* Source: Martin Barbella



Test method:


The following procedures (methods) may be offensive and are intended only for security research and teaching. Users are at your own risk!


Vendor patch:

The vendor has released a patch to fix this security problem. Please download it from the vendor's homepage:


Related Article

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: 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.