Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not long time ago Rails had an attack vector very similar to this, IIRC.


Yep, same thing but with YAML deserialization. Deserialization vulnerabilities are common for Java, Python, Ruby, and PHP web apps, because deserializing an untrusted input is nearly akin to running eval() on an untrusted input.


1. Define exactly what the deserialization output should be. 2. Implement it that exactly that way. Now it's simple. Does the definition in part (1) include execution of arbitrary commands?


A deserializer might be able to instantiate arbitrary classes, so any class with a constructor that could execute an arbitrary command makes the deserializer vulnerable.

Of course, the correct answer is not to use the deserializer that can instantiate arbitrary classes when you have a well-defined list of classes that can be instantiated.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: