Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DOMParser to secure setting innerHTML #1930

Merged
merged 1 commit into from Mar 27, 2020

Conversation

limonte
Copy link
Member

@limonte limonte commented Mar 27, 2020

Fixes #1926

element.innerHTML = is not used anymore 馃帀 Instead, DOMParser is used, docs: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser

Many thanks to @september28 for his valuable input!

@limonte limonte added the severity4: security No one wants a CVE on SweetAlert2 label Mar 27, 2020
@limonte
Copy link
Member Author

limonte commented Mar 27, 2020

Seems good, all tests are passing.

I'll go ahead and merge it, but the release will be done tomorrow. If anybody has anything to add here, please do so.

Once again, thank you @september28 for the exemplary issue-report 馃憦

@limonte limonte merged commit 18c5a63 into master Mar 27, 2020
@limonte limonte deleted the fix/use-DOMParser-for-secure-setting-innerHTML branch March 27, 2020 21:47
@limonte
Copy link
Member Author

limonte commented Mar 28, 2020

Some tests are failing in IE11: https://github.com/sweetalert2/sweetalert2/runs/541098252?check_suite_focus=true

Unable to get property 'childNodes' of undefined or null reference

limonte added a commit that referenced this pull request Mar 28, 2020
limonte added a commit that referenced this pull request Mar 28, 2020
limonte added a commit that referenced this pull request Mar 28, 2020
limonte pushed a commit that referenced this pull request Mar 28, 2020
## [9.10.7](v9.10.6...v9.10.7) (2020-03-28)

### Bug Fixes

* use DOMParset only if html is not empty ([#1931](#1931)) ([54463ec](54463ec)), closes [/github.com//pull/1930#issuecomment-605412269](https://github.com//github.com/sweetalert2/sweetalert2/pull/1930/issues/issuecomment-605412269)
* use DOMParset to secure setting innerHTML ([#1930](#1930)) ([18c5a63](18c5a63))
@limonte
Copy link
Member Author

limonte commented Mar 28, 2020

馃帀 This PR is included in version 9.10.7 馃帀

The release is available on:

Your semantic-release bot 馃摝馃殌

matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this pull request Mar 29, 2023
matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this pull request Mar 29, 2023
matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this pull request Mar 29, 2023
## [9.10.7](sweetalert2/sweetalert2@v9.10.6...v9.10.7) (2020-03-28)

### Bug Fixes

* use DOMParset only if html is not empty ([sweetalert2#1931](sweetalert2#1931)) ([56f0928](sweetalert2@56f0928)), closes [/github.com/sweetalert2/pull/1930#issuecomment-605412269](https://github.com//github.com/sweetalert2/sweetalert2/pull/1930/issues/issuecomment-605412269)
* use DOMParset to secure setting innerHTML ([sweetalert2#1930](sweetalert2#1930)) ([dedec23](sweetalert2@dedec23))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released severity4: security No one wants a CVE on SweetAlert2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content Security Policy (CSP) compliance
1 participant