GithubHelp home page GithubHelp logo

Demo Output Confusing about dompurify HOT 5 CLOSED

cure53 avatar cure53 commented on July 24, 2024
Demo Output Confusing

from dompurify.

Comments (5)

cure53 avatar cure53 commented on July 24, 2024

Heya,

I understand what you mean. Currently, the demo is basically a large bunch of test vectors that we simply write to the DOM to show that no dangerous HTML slips through. So the huge red letters are in fact expected behavior :)

What would you suggest to make it better? One thing I could imagine would be less HTML and annotations explaining what happens. We could do that as soon as we have a test-suite running (cc @fhemberger ). Right now the demo is a quasi test-suite. That is of course not ideal.

Do you have any specific suggestions of how to make the demo be more intuitive and friendly?

from dompurify.

Miserlou avatar Miserlou commented on July 24, 2024

I think explaining what's actually happening during the test is very useful, as is having an example or description of the expected behaviour.

(Also, as an aside, if Style tags are allowed, how does it handle remote includes in styles? https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#STYLE_sheet)

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

Makes sense. I'll tidy up the demo once we have a test-suite. Thanks for raining this issue!

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

I have added some extra text to explain what happens. I also changed the jQuery stress-test to use html() instead of the factory. A quick look at the wording and maybe a pull request in case the wording is still confusion would be appreciated ;) I am not a great texter and it wasn't confusing to me before - so not sure if my change hit the target.

About your question on CSS and remote styles: The info given in the OWASP "cheatsheet" is hopelessly outdated. It is not possible to cause XSS using CSS on modern browsers (as far as I know). There's a whole bunch of UI attacks and what not but we don't consider them in scope for the DOMPurify default values. Anyone can however simply remove <style> from the list of permitted elements to be 101% safe and secure.

from dompurify.

Miserlou avatar Miserlou commented on July 24, 2024

Looks great to me!

from dompurify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.