PHP socket_recv() Signed Integer Memory Corruption Vulnerability
BID:7197
Info
PHP socket_recv() Signed Integer Memory Corruption Vulnerability
| Bugtraq ID: | 7197 |
| Class: | Failure to Handle Exceptional Conditions |
| CVE: | |
| Remote: | No |
| Local: | Yes |
| Published: | Mar 26 2003 12:00AM |
| Updated: | Mar 26 2003 12:00AM |
| Credit: | Discovery of this vulnerability credited to Sir Mordred <[email protected]>. |
| Vulnerable: |
PHP PHP 4.3.1 PHP PHP 4.3 PHP PHP 4.2.3 PHP PHP 4.2.2 PHP PHP 4.2.1 PHP PHP 4.2 .0 PHP PHP 4.1.2 PHP PHP 4.1.1 PHP PHP 4.1 .0 PHP PHP 4.0.7 PHP PHP 4.0.6 PHP PHP 4.0.5 PHP PHP 4.0.4 PHP PHP 4.0.3 PHP PHP 4.0.2 PHP PHP 4.0.1 PHP PHP 4.0 0 |
| Not Vulnerable: | |
Discussion
PHP socket_recv() Signed Integer Memory Corruption Vulnerability
A vulnerability has been reported in PHP versions 4.3.1 and earlier. The problem occurs in the socket_recv() and may allow an attacker to corrupt memory. Specifically, the affected function fails to carry out sanity checks on user-supplied argument values, making it prone to an integer overflow.
This may make it possible for an attacker to trigger a denial of service. Although it has not been confirmed, it may also be possible to exploit this issue to execute arbitrary code.
It should be noted that socket functionality is only included in PHP if compiled with the "--enable-sockets" option.
A vulnerability has been reported in PHP versions 4.3.1 and earlier. The problem occurs in the socket_recv() and may allow an attacker to corrupt memory. Specifically, the affected function fails to carry out sanity checks on user-supplied argument values, making it prone to an integer overflow.
This may make it possible for an attacker to trigger a denial of service. Although it has not been confirmed, it may also be possible to exploit this issue to execute arbitrary code.
It should be noted that socket functionality is only included in PHP if compiled with the "--enable-sockets" option.
Exploit / POC
PHP socket_recv() Signed Integer Memory Corruption Vulnerability
The following proof of concept was provided:
<?php
$buf = "";
socket_recv(socket_create(AF_INET, SOCK_STREAM, 0), $buf, -3, 0);
?>
The following proof of concept was provided:
<?php
$buf = "";
socket_recv(socket_create(AF_INET, SOCK_STREAM, 0), $buf, -3, 0);
?>
Solution / Fix
PHP socket_recv() Signed Integer Memory Corruption Vulnerability
Solution:
It has been reported that this issue is being addressed in PHP 4.3.2 however, this has not been confirmed.
Currently we are not aware of any vendor-supplied patches for this issue. If you feel we are in error or are aware of more recent information, please mail us at: [email protected] <mailto:[email protected]>.
Solution:
It has been reported that this issue is being addressed in PHP 4.3.2 however, this has not been confirmed.
Currently we are not aware of any vendor-supplied patches for this issue. If you feel we are in error or are aware of more recent information, please mail us at: [email protected] <mailto:[email protected]>.
References
PHP socket_recv() Signed Integer Memory Corruption Vulnerability
References:
References:
- PHP Homepage (PHP Group)
- @(#)Mordred Labs advisory - Integer overflow in PHP memory allocator (Sir Mordred
)