fix: add rel option to external links in content (#1853)

* #1853: XSS attack fix by adding rel noferrer or rel noopen to _blank target external links

* fix: relAttributeExternalLink noopener

Co-authored-by: danallendds <daniel.allen@friends.dds.mil>
Co-authored-by: Nicolas Giard <github@ngpixel.com>
This commit is contained in:
daneallen
2020-05-07 16:45:11 -04:00
committed by GitHub
parent 6624df2c63
commit 4aa7828a92
3 changed files with 11 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ module.exports = {
input = xss(input, {
whiteList: {
...xss.whiteList,
a: ['class', 'id', 'href', 'style', 'target', 'title'],
a: ['class', 'id', 'href', 'style', 'target', 'title', 'rel'],
blockquote: ['class', 'id', 'style'],
code: ['class', 'style'],
details: ['class', 'style'],