New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notice field removes target="_blank" attribute in <a> tags #11477
Comments
This seems to be because notice interface passes the content via
And the Lines 1 to 9 in b8c4317
This is also a known issue in dompurify: cure53/DOMPurify#317 As seen in the follow up comments in that thread, this can be resolved with dompurify's hooks, but this comment also does mention the security concern with this as well: cure53/DOMPurify#317 (comment). @rijkvanzanten thoughts on this? |
About the security concern, the Links to cross-origin destinations are unsafe gives the solution: And this is exactly what Directus already does when we add a new external URL to the modules menu: Unfortunately in a Notice, after sanitization, |
Thanks for the elaboration. Technically the directus/app/src/components/v-button/v-button.vue Lines 28 to 29 in 748ee97
but yea in the Notice interface case, dompurify ended up being the one sanitizing/removing |
Preflight Checklist
Describe the Bug
Is there a reason not to render
target="_blank"
To Reproduce
<a href="my.pdf" target="_blank">Please click here</a>
<a href="my.pdf">Please click here</a>
This is strange as the recorded content is
<a href=\"my.pdf\" target=\"_blank\">Please click here</a>
Errors Shown
Does not open in a new tab.
What version of Directus are you using?
9.5.1
What version of Node.js are you using?
14.17.1
What database are you using?
SQLite version 3.37.0
What browser are you using?
Firefox
What operating system are you using?
Windows_NT 10.0.19043
How are you deploying Directus?
locally
The text was updated successfully, but these errors were encountered: