addressing unsafe uses of the sanitizer, bug 1192595
This commit is contained in:
Родитель
c1315eb25b
Коммит
a8f9e0e2b3
|
@ -226,6 +226,26 @@ eslintTester.run("no-unsafe-innerhtml", rule, {
|
|||
type: "AssignmentExpression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1192595
|
||||
{
|
||||
code: "x.innerHTML = Sanitizer.escapeHTML(evil)",
|
||||
errors: [
|
||||
{
|
||||
message: "Unsafe assignment to innerHTML",
|
||||
type: "AssignmentExpression"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
code: "x.innerHTML = Sanitizer.escapeHTML(`evil`)",
|
||||
errors: [
|
||||
{
|
||||
message: "Unsafe assignment to innerHTML",
|
||||
type: "AssignmentExpression"
|
||||
}
|
||||
],
|
||||
ecmaFeatures: { templateStrings: true }
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче