Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
codedokode
· 8y ago · 0 comments
Slash doesn't need to be encoded. Only 5 characters that have special meaning have to be encoded (&, <, >, " and ').
Comments
[–]
hawkice
8y ago
Which raises the best question: how would you exploit someone not escaping single quotes? I do not know. Perhaps it isn't possible.
[–]
jscissr
8y ago
I think escaping quotes only matters for attributes (which can use ' or "). Example:
<img src="$url">
Exploit:
foo.jpg" onload="alert('pwned')
[–]
kuroguro
8y ago
Heh, found the exact bug on a live bbcode parser some 5 years ago.
[–]
codedokode
OP
8y ago
It was probably written using regexps? One should make full syntax analysis instead of writing regexp hacks.