diff --git a/FU/Util.pm b/FU/Util.pm index cd34fd3..a9cca1d 100644 --- a/FU/Util.pm +++ b/FU/Util.pm @@ -212,13 +212,6 @@ roughly similar to: JSON::PP->new->allow_nonref->core_bools->convert_blessed->encode($scalar); -Some modules escape the slash character in encoded strings to prevent a -potential XSS vulnerability when embedding JSON inside C<< >> tags. This function does I do that because it might not even -be sufficient. The following is probably an improvement: - - json_format($data) =~ s{>, C<< > >> and C<< & >> as Unicode escapes. +Commonly used to embed data inside a HTML page: + + $html = ''; + +This option does NOT make it safe to include the encoded JSON as an attribute +value. There is no way to do that without violating JSON specs, so you should +use entity escaping instead. + +Some JSON modules escape the forward slash (C) character instead, but that +is, at best, B sufficient for embedding inside a C<<