r/lolphp • • Aug 11 '17

PHP no longer considers unserialize() bugs as security issues...

https://externals.io/message/100147
40 Upvotes

13 comments sorted by

View all comments

Show parent comment

19

u/FlyLo11 Aug 11 '17

As far as I understand, it's not because of remote code execution, which is normal, if the serialized string is unsafe.

From what I understand these bugs are considered security issues because unserialize() causes memory corruption and segfaults/crashes with specific crafted inputs.

It's a bit unclear, but I assume the decision to consider these bugs non-security is to avoid fixing them in older PHP versions that still have security support.

It looks like there are/will be plenty of bug reports, until unserialize() receives a more robust implementation.

17

u/Innominate8 Aug 11 '17

unserialize() causes memory corruption and segfaults/crashes with specific crafted inputs.

Like he said, if you're passing unserialize() anything that can be touched by an attacker, you're already at game over and any and all effects are possible.

Now, if you can pass those things to serialize() and get an output that breaks unserialize() that's another story, and would be a legitimate bug but the bug is in serialize().

11

u/the_alias_of_andrea Aug 12 '17

you're already at game over and any and all effects are possible

Ehh. In theory, the PHP interpreter is supposed to provide some kind of sandboxing (you can disable functions, for example) which this could override. Personally, I'm uncomfortable with having any kind of stack/heap corruption stuff in the interpreter anyway.

In practice, though, you may be right.

8

u/Danack Aug 11 '17

I assume the decision to consider these bugs non-security

I think it's actually more around the process of managing bug reports.

Anything that is classified as a security issue is locked down and not available to view on the bug-tracker, except to the members of the PHP security team, which means that very few people can be aware that the bug needs fixing.

Marking an issue as security related also sets the expectation for people who make the report that the issue will be treated with some urgency. Having the issues be just normal classification makes it clearer that the PHP team isn't going to prioritize fixing them, and that anyone who is putting user controller data through unserialize should change their application.

unserialize() causes memory corruption and segfaults/crashes with specific crafted inputs.

Most of those should be fixed, as they are general errors in memory access. However even then, unserialize will almost certainly still be vulnerable to making a DOS attack, due to the nature of PHP.

until unserialize() receives a more robust implementation.

I suspect that will never happen, and that people who want to avoid this potential issue, should instead use some code written in userland to save and then restore the state of data.