Displaying 2 results from an estimated 2 matches for "sanizit".
Did you mean:
sanizite
2012 Dec 08
0
Security - How to sanizitize JSON?
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
2009 Apr 12
9
invalid byte sequence utf-8 OR best option to sanitize content brought in with net::http? single non-utf character causes rails to crash
...non-utf8 characters, the encoding is set to ascii8bit
and when i do force_encoding(utf-8), valid_encoding is false and the
page just fails. html::sanitize isn''t an option as i don''t want to
strip the tags. the content is from internal trusted servers that i
control. i just need to sanizite, i guess, the bad characters.
my thoughts/questions:
1) seems like rails should be less brittle about managing encoding
such that blank? doesn''t just fail when the valid_encoding is false.
or you shouldn''t be able to create a string if the encoding is bad. or
it should make best...