mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
SECURITY: A user could XSS themselves on their preference page
This commit is contained in:
@ -19,6 +19,17 @@ componentTest('preview updates with markdown', {
|
||||
}
|
||||
});
|
||||
|
||||
componentTest('preview sanitizes HTML', {
|
||||
template: '{{d-editor value=value}}',
|
||||
|
||||
test(assert) {
|
||||
this.set('value', `"><svg onload="prompt(/xss/)"></svg>`);
|
||||
andThen(() => {
|
||||
assert.equal(this.$('.d-editor-preview').html().trim(), '<p>\"></p>');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
componentTest('updating the value refreshes the preview', {
|
||||
template: '{{d-editor value=value}}',
|
||||
|
||||
|
Reference in New Issue
Block a user