Sanitize HTML
See original GitHub issueNot really sure if this is something Staticman should handle or not, but putting this out there.
I recently was made aware that arbitrary HTML could be passed in my comments. Which basically means someone can drop in <style>
or <script>
tags into a comment’s message and mess with the page.
Easy way around that would be to use Jekyll’s strip_html
filter on that data, but that ruins the ability to leave nicely formatted code blocks written in Markdown… which go through the markdownify
filter.
This isn’t that big of an issue for me since I have moderation on, but for those who blindly let Staticman publish comments they could be exposing their site.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
sanitize-html - npm
sanitize -html provides a simple HTML sanitizer with a clear API. sanitize-html is tolerant. It is well suited for cleaning up HTML fragments ......
Read more >HTML Sanitizer API - MDN Web Docs
The HTML Sanitizer API allow developers to take untrusted strings of HTML and Document or DocumentFragment objects, and sanitize them for ...
Read more >HTML sanitization - Wikipedia
In data sanitization, HTML sanitization is the process of examining an HTML document and producing a new HTML document that preserves only whatever...
Read more >What you need to know about inbuilt browser HTML sanitization
HTML sanitization is an OWASP-recommended strategy to prevent XSS vulnerabilities in web applications. HTML sanitization offers a security ...
Read more >Top 5 sanitize-html Code Examples - Snyk
Learn more about how to use sanitize-html, based on sanitize-html code examples created from the most popular ways it is used in public...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Definitely something we can do. Thanks for flagging, I’ll look into that.
@mmistakes @eduardoboucas It’s been 4 years, hasn’t found a solution yet? Anyone have any ideas on this?