GithubHelp home page GithubHelp logo

purify style elements? about dompurify HOT 4 CLOSED

cure53 avatar cure53 commented on June 25, 2024
purify style elements?

from dompurify.

Comments (4)

cure53 avatar cure53 commented on June 25, 2024

I am tempted to do it but am not sure about the right way to do it. Yet. It is however on the Todo list.

Google's Caja has additional jobs to do, we only do the stuff inside < and > so we can stay lightweight and avoid complexity ;)

from dompurify.

dashed avatar dashed commented on June 25, 2024

I'm not familiar with parsing. Are there certain potential issues?

I'm looking around for potential CSS parsers such as this:
https://github.com/reworkcss/css
https://github.com/reworkcss/rework

Potentially, a plugin on top of rework would throw errors on blacklisted/whitelist syntax. I haven't looked too much into it yet.

from dompurify.

cure53 avatar cure53 commented on June 25, 2024

The problem is: I don't wanna rely too much on external plug-ins. Once security is the primary focus, this is not really an option. We cannot keep a securoty promise and at the same time rely on what other people do in some repo.

Then, CSS inside style attributes or style elements is not a cause of XSS any more. At least not in the UAs DOMPurify supports. So the first question here would be: what's the threat model?

What then pops up first is HTTP leakage of course. Then again, we do not prevent leakage in HTML yet. Which is kind of a step that has to be taken before we walk down the CSS rabbit-hole. So, it's complicated :)

from dompurify.

cure53 avatar cure53 commented on June 25, 2024

I have decided to close this one for now - there's no urgent need for this feature and I'd prefer to create a library on its own that is capable of doing so. Possible to have this be combined with DOMPurify in a later stage.

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.