-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
I guess it is fine if hljs already escapes dangerous characters in the source.
We currently do > < &... it looks like we should maybe add a few?
& -------> &
< -------> <
> -------> >
" -------> "
' -------> '
/ -------> /
Should that cover it? I'm not sure (off the top of my head) how the quotes or / could break out on their own though without the tag characters... I think the quotes are more about raw insertion anywhere (like in the middle of an HTML attribute) as shown here:
That's not what we do... although now I'm wondering if there is a potential attack vector with a evilly coded grammar via className. Although grammars already run any JS they want freely though, so some sort of attack via className would be the HARD way to do it.
Originally posted by @yyyc514 in #2537 (comment)