mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
SECURITY: sanitize markdown urls (prevent XSS)
This commit is contained in:
parent
d5b1b64bb8
commit
e663d78104
2 changed files with 15 additions and 0 deletions
|
@ -352,6 +352,8 @@ test("sanitize", function() {
|
|||
equal(sanitize("<textarea>hullo</textarea>"), "hullo");
|
||||
equal(sanitize("<button>press me!</button>"), "press me!");
|
||||
equal(sanitize("<canvas>draw me!</canvas>"), "draw me!");
|
||||
|
||||
cooked("[the answer](javascript:alert(42))", "<p><a>the answer</a></p>", "it prevents XSS");
|
||||
});
|
||||
|
||||
test("URLs in BBCode tags", function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue