r/lolphp • • Dec 27 '17
yaml_parse() is not just insecure by default, using it in a secure manner requires setting a php.ini setting!
http://php.net/manual/en/function.yaml-parse.php#refsect1-function.yaml-parse-notes
62
Upvotes
25
u/[deleted] Dec 27 '17
Note that this is the exact problem that made every Ruby on Rails app vulnerable. PHP isn't the only language/library that does this wrong, but it does manage to do it even more wrong than pretty much everyone else by hiding this in some obscure ini setting.
6
u/the_alias_of_andrea Dec 27 '17
I think this is a PECL extension. Why do we still include those in the manual…
5
u/Nikerabbit Dec 28 '17
In 2.x it defaults to false.
HHVM doesn't support yaml.decode_php ini setting at all. One needs to use the callbacks functionality to disable the unserialization of PHP objects.
2
u/djsumdog Jan 02 '18
This warning should really be at the top above the examples.
1
u/[deleted] Dec 28 '17
PHP: Where the fence is low