GithubHelp home page GithubHelp logo

Comments (4)

cure53 avatar cure53 commented on July 24, 2024

That's a problem indeed. With data URIs, an attacker can do bad. Not in all contexts. But some. For example, data URIs are bad for <a> but not for <img>. Then they are fine for SVG's <image> but not for for mask or even <object> - unless the type indicates it's an image. We can have XSS with data URIs in Firefox - but only script execution in Chrome (on about:blank) and so on and so on.

This lead to the decision that data URIs are bad and cannot be trusted. I want to avoid having a maintenance-heavy if-else-tree deciding when data URI s re good and when they are bad. So I consider them all to be bad. Same with srcdoc for example.

from dompurify.

hyderali avatar hyderali commented on July 24, 2024

This is an important requirement, without this all the images appears just blank.

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

I believe this should work now. I enabled data URIs for <img> and <img> only as in most other context we can do bad. Meets the requirements?

Side-note: Data URIs in CSS should be enabled by default.

from dompurify.

hyderali avatar hyderali commented on July 24, 2024

Thank you.
@cure53 You rock 👍

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.