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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Trusted Types and escape HTML special characters #2858

Open
shhnjk opened this issue Mar 10, 2022 · 0 comments · May be fixed by #2846
Open

Support Trusted Types and escape HTML special characters #2858

shhnjk opened this issue Mar 10, 2022 · 0 comments · May be fixed by #2846

Comments

@shhnjk
Copy link

shhnjk commented Mar 10, 2022

Bug reports:

html2canvas has Trusted Types violation due to use of document.write API which is considered a dangerous sink for XSS. This change fixes that and make html2canvas compatible with Trusted Types.

The usage of document.write in html2canvas is also dangerous in a way that, it might have potential to trigger XSS with DOM Clobbering.

E.g.

<body>
<form name="doctype"></form>
<script>
console.log(document.doctype); // This returns the form above
</script>
</body>

Specifications:

  • html2canvas version tested with: 1.4.1
  • Browser & version: Chrome 99
  • Operating system: Windows 11
@shhnjk shhnjk linked a pull request Mar 10, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant