Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ilia Alshanetsky's Blog:
phpBB & Unserialize Bug
Dec 20, 2004 @ 17:33:00

Ilia Alshanetsky's blog has a new posting today relating to the unserialize bug mentioned the other day - and how it can be used to do thing with phpBB such as steal passwords.

As most of you hopefully know, a few days ago PHP 4.3.10 and 5.0.3 were released in response to several vulnerabilities that were discovered. Two of those involved bugs in unserialize function that is used to re-create PHP variables based on an encoded string normally generated by serialize() function. This functionality allows storage & retrieval of PHP variables from outside PHP.

While these two problems are quite serious, they can normally only be exploited locally, meaning that you'd need an account with access to PHP on the server. However, several applications such as phpBB store serialized data inside cookies meaning that anyone accessing those applications will be able to supply their own serialized string. By tinkering with this string it is possible to make an exploit capable of doing things like theft of passwords.

Of course, their assesment of the situation is incorrect (as Ilia points out) and really should be corrected on both sides of the equation. While unserialize is certainly a bug in PHP, the fact it is remotely exploitable is the fault of script writers who do not take the time to properly validate user input.

tagged:

Link:


Trending Topics: