Hi, I''m on Rails 3.2.8 and one of my apps sends some json to create DB objects. What''s the best way to sanitize json? I found this post claiming that for json we need to escape manually since json_escape is broken: http://blog.bigbinary.com/2012/05/10/xss-and-rails.html I tried using the sanitize gem (https://github.com/rgrove/sanitize/) but when using it on a json string it returns NoMethodError (undefined method `strip'' for #<ActiveSupport::HashWithIndifferentAccess:... Later on I generate json that is presented raw in the browser and part of that json is comming from this initial json so it is vulnerable to XSS. (soon I''ll try to get if of the need of using raw). So any general advice how to make sure the json does not contain any malicious code? Or how to use the sanitize gem with json? Cheers. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.