Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is PHP buffer overflow possible? [duplicate]

Possible Duplicate:
How to conduct buffer overflow in PHP/Python?

I was reading this tutorial, when I came into this:

A buffer overflow attack seeks to overflow the memory allocation buffer inside your PHP application or, more seriously, in Apache or the underlying operating system. Remember that you may be using a high-level language like PHP to code your Web applications, but at the end of the day, you're calling C (in the case of Apache) to do work. And C, like most low-level languages, has strict rules about allocation of memory..

What? I knew that PHP was well error-checked and so buffer overflow wasn't possible. Should I check user input length to avoid too big data flow? Thank you very much

like image 812
Surfer on the fall Avatar asked Aug 05 '12 15:08

Surfer on the fall


People also ask

Is PHP vulnerable to buffer overflow attacks?

Thus, your PHP applications are safe from buffer overflows, but PHP is not. Then a PHP application is vulnerable to buffer overflow, But checking all the data for their length taking time!

What happens when a buffer is overflowed?

A buffer overflow (or buffer overrun) occurs when the volume of data exceeds the storage capacity of the memory buffer. As a result, the program attempting to write the data to the buffer overwrites adjacent memory locations.

What are the possible causes for occurring buffer overflow?

Coding errors are typically the cause of buffer overflow. Common application development mistakes that can lead to buffer overflow include failing to allocate large enough buffers and neglecting to check for overflow problems.

Can buffer overflow cause data to be rewritten?

A buffer overflow occurs when the amount of data provided or entered exceeds the storage capacity of the memory buffer. As a result of this excess data, the program will attempt to write the data. In this case, buffer overwrites adjacent memory locations.


1 Answers

Yes it is and in the current change log there has been 15 bug fixes related to it:

  • Fixed bug #61807 Buffer Overflow in apache_request_headers, CVE-2012-2329.
  • Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas
  • Fixed bug #60965 (Buffer overflow on htmlspecialchars/entities with $double=false).
  • Fixed stack buffer overflow in socket_connect(). (CVE-2011-1938) Found by Mateusz Kocielski, Marek Kroemeke and Filip Palian. (Felipe)
  • Fixed possible buffer overflows in mysqlnd_list_fields, mysqlnd_change_user. (Andrey)
  • Fixed possible buffer overflows when handling error packets in mysqlnd. Reported by Stefan Esser. (Andrey)
  • Fixed a possible dechunking filter buffer overflow. Reported by Stefan Esser. (Pierre)
  • Fixed bug #42862 (IMAP toolkit crash: rfc822.c legacy routine buffer overflow). (Fixes CVE-2008-2829) (Dmitry)
  • Fixed possible stack buffer overflow in FastCGI SAPI. (Andrei Nigmatulin)
  • Fixed possible triggering of buffer overflows inside glibc implementations of the fnmatch(), setlocale() and glob() functions. Reported by Laurent Gaffie.
  • Fixed bug #42222 (possible buffer overflow in php_openssl_make_REQ). (Pierre)
  • Fixed a remotely trigger-able buffer overflow inside make_http_soap_request(). (Ilia)
  • Fixed a buffer overflow inside user_filter_factory_create(). (Ilia)
  • Fixed a remotely trigger-able buffer overflow inside bundled libxmlrpc library. (Stas)
like image 145
Esailija Avatar answered Sep 18 '22 12:09

Esailija