3 ms·
I don't think defensive programming would have based on the current situation across a number of languages. Basically no serializer in any language PHP, Python,
by hjr3 14y ago
I don't think defensive programming would have based on the current situation across a number of languages. Basically no serializer in any language PHP, Python, Rails, etc is completely safe. There are known exploits for all of them.
There is lots of magic in rails, but I bet there are a number of popular PHP and Python libraries/frameworks that are unserializing in an unsafe way.
- ab 14y agoThere's an enormous difference between serializers that make any effort at all to be safe, and those like Ruby's YAML library, which make no effort. Python's YAML, for example, exposes a safe_load() method. It's really criminally negligent that no such method exists in Ruby's YAML library.
- vidarh 14y agoDefensive programming in this case would be to not use a general purpose de-serializer for a format that is explicitly designed to allow serialising arbitrary objects....
- gcr 14y agoSerializers aren't inherently unsafe. Look at Lisp's (read) method, for example, which does not evaluate anything.