GithubHelp home page GithubHelp logo

Comments (13)

fhemberger avatar fhemberger commented on July 24, 2024

If it's a breaking change, that means this should be a 1.0.0 release (semver-major). And the reason for it should be documented. What browsers could break by switching from document.implementation.createHTMLDocument to window.DOMParser?

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

It might be a breaking change but I hope it's not, hence my review request :) So far it looks like it's not - but I cannot judge that on my own.

from dompurify.

fhemberger avatar fhemberger commented on July 24, 2024

If all the browser tests are green, it seems to work … I'm sorry, but at some point you lost me with all the DOM voodoo going on. I must admit, I'm not that much into that particular topic to be of much help here. (Especially after exclusively working on the server side the last 14+ months.) ;)

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

Aye, okay :) Are the code conventions all met? If so, I'd merge and prepare a release.

from dompurify.

mozfreddyb avatar mozfreddyb commented on July 24, 2024

s/@freddyb/@mozfreddyb ;-)

from dompurify.

fhemberger avatar fhemberger commented on July 24, 2024

LGTM

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

Thx. I am preparing the 0.6.7 release now.

from dompurify.

koto avatar koto commented on July 24, 2024

So, what was the bypass?

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

It was documented along with the release:

https://github.com/cure53/DOMPurify/releases/tag/0.6.7

<script>
// This is SAFE (but shouldn't be!)
document.body.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">'
</script>


<script>
// This is UNSAFE
document.write('<svg><p><style><img src="</style><img src=x onerror=alert(1)//">')
</script>

from dompurify.

mozfreddyb avatar mozfreddyb commented on July 24, 2024

I think it was mentioned in the release notes, here's the issue discussed in Bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=1205631

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

@mozfreddyb "discussed" :)

The issue is still existing, FF is still unreliable and delivers broken innerHTML.
DOMPurify patches around it successfully - but we had to change a lot for that.

from dompurify.

mozfreddyb avatar mozfreddyb commented on July 24, 2024

Seems like a spec problem to me. shrugs
document.write was invented when HTML parsing wasn't properly defined.
You may have also gotten better results when supplying a doctype prior to your .write().

from dompurify.

cure53 avatar cure53 commented on July 24, 2024

Nope, it's a Firefox problem :)

FF doesn't properly handle innerHTML in the SVG context. Even MSIE does it right :P

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.