-
Notifications
You must be signed in to change notification settings - Fork 4k
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
XSS CS Update #103
XSS CS Update #103
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for me.
Thank you very much for the PR 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR.
I like that you added DOMPurify from cure53 (in fact I am very surprised that it was not there)
I am even more happy that you spotted old, unsupported library on that list.
But I think that we should not add here https://github.com/punkave/sanitize-html.
Libraries on that list should be designed to clean potentially malicious HTML from untrusted source to prevent XSS. HTML sanitizer from Closure, PHP HTML Purifier, Python Bleach and DOMPurify from cure53 do that but I never heard of https://github.com/punkave/sanitize-html.
Documentation for this library tells that "sanitize-html is tolerant. It is well suited for cleaning up HTML fragments such as those created by ckeditor and other rich text editors. It is especially handy for removing unwanted CSS when copying and pasting from Word.". This is not our use case. IIn addition, from what I saw, it does not sanitize javascript code by default. User have to specify what should be allowed (tags, attubutes, etc.) and what not. Summarising this is not security library and we cannot guarantee that it will protect users from XSS.
As I wrote before I never heard of this library and I only checked documentation so if I am wrong somewhere and this library can delete javascript please tell me :)
First off, I completely defer to your decisions about what goes in. I wrote in #101:
If the security posture of punkave/sanitize-html is not sufficiently intolerant and obvious enough to warrant inclusion, then I think we should leave sanitize-html out and encourage Node.js devs to use DOMPurify with JSDOM. The fact that you have heard of DOMPurify and were surprised it was not there speaks volumes. That said, sanitize-html does remove JS. From the README opening section:
Further down in "What are the default options?":
Later on:
So by default...
Thought I would clarify all that to clear up any misunderstanding, but I will add a commit that removes |
Thank you for detailed answer! @ThunderSon what do you think? |
I am all for sticking to the de facto standard libs already familiar to OWASP contributors. While we are on the subject, should we rearrange the order to keep languages together and possibly add (JavaScript/Node.js) to the end of the Closure listing to be super explicit? Like so: Other libraries that provide HTML Sanitization include:
|
Looks like maybe we should not capitalize jsdom either, and maybe we should lose "DOM-only" and link that too? So: Other libraries that provide HTML Sanitization include:
|
We could also probably save lazy devs tons of time by linking to the HTML sanitizer docs, not easy to find from the main Closure link. Although https://github.com/google/closure-library/blob/master/closure/goog/html/sanitizer/htmlsanitizer.js has a simple usage example currently on Line 23. So maybe adjust HTML sanitizer link to htmlsanitizer.js and add docs link at end? Other libraries that provide HTML Sanitization include:
|
Please put https://www.owasp.org/index.php/OWASP_Java_HTML_Sanitizer_Project back it. It’s actively maintained by Mike Samuel via Google.
Aloha,
--
Jim Manico
@manicode
Secure Coding Education
+1 (808) 652-3805
… On May 10, 2019, at 3:26 PM, Ricky de Laveaga ***@***.***> wrote:
I am all for sticking to the de facto standard libs already familiar to OWASP contributors. While we are on the subject, should we rearrange the order to keep languages together and possibly add (JavaScript/Node.js) to the end of the Closure listing to be super explicit?
Like so:
Other libraries that provide HTML Sanitization include:
HTML sanitizer from Google Closure Library (JavaScript/Node.js)
DOMPurify (JavaScript, DOM-only, requires JSDOM for Node.js)
PHP HTML Purifier
Python Bleach
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
No worries Jim we did not deleted https://www.owasp.org/index.php/OWASP_Java_HTML_Sanitizer_Project it is recommended for Java :) |
@rdela I like your ideas about rearrange the order and improve linking to the closure docs and example. |
@mackowski Updated with suggested changes from my last comment #103 (comment) Travis build is failing but looks like that is only missing newlines in other cheatsheets? Want me to add them? |
Give some time, i will fix it. |
I have added info about the TravisCI job issue to fix it in existing PR. |
* upstream/master: - Update policy according to new rules added by https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md - Fix iteration_count number typo (#100) sync .markdownlint.json with master #105 (comment) > In fact new audit rules has been added to the markdownlint plugin, precisely MD046 and MD047. > > As I take the latest version of the plugin during the CI job then these new rules are enabled by default and have caused rejection on existing CS. > > I have updated the policy and tested it against the master branch and it's OK now: > > $ bash Apply_Linter_Check.sh > [+] No error found by the Linter. > Existing PR must sync their version of the file .markdownlint.json with the one from the master branch (override PR content of this file with the content coming from the master branch).
Thanks @righettod! PR updated and Travis is passing now ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
This PR covers issue #101
Update JS/Node.js libs in Cross Site Scripting Prevention Rule 6 "Other libraries that provide HTML Sanitization":
Line 344 linked to ecto/bleach as "JavaScript/Node.js Bleach"
Now Line 344-5 link to:
...as: