Extracted from official patchs.
- Add files in '/config/initializers' directory.
To test the JSON parser (CVE-2013-0269), try to parse a malicious json:
- In console, before patch:
>> JSON.parse "{\"json_class\":\"JSON::GenericObject\",\"foo\":\"bar\"}"
=> #<JSON::GenericObject foo="bar">
or
=> ArgumentError: undefined class/module JSON::GenericObject
- After patch:
>> JSON.parse "{\"json_class\":\"JSON::GenericObject\",\"foo\":\"bar\"}"
=> {"json_class"=>"JSON::GenericObject", "foo"=>"bar"}