Fix a few edge cases for XSS
This commit is contained in:
parent
271a23cdad
commit
1c3273978b
2 changed files with 20 additions and 4 deletions
|
|
@ -10,6 +10,11 @@ function basicTest() {
|
|||
|
||||
assert(sanitize("<a href='javascript:alert(document.cookie)'>") ===
|
||||
"<a href=\":()\">");
|
||||
|
||||
assert(sanitize("<a ") === "<a>");
|
||||
|
||||
assert(sanitize("<img src=\"<a href=\"javascript:void(0)\">>") ===
|
||||
"<img src=\"<a href=\" javascriptvoid0=\"\">>");
|
||||
}
|
||||
|
||||
basicTest();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue