workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

fix: Workers DOM Clobbering gadget found in vite bundled scripts that leads xss

Open WonDKim opened this issue 1 year ago • 1 comments

We discovered a DOM Clobbering vulnerability in Vite when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present. DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. More for information about DOM Clobbering, here are some references:

Author has addressed the following

  • Tests
    • [ ] TODO (before merge)
    • [x] Tests included
    • [ ] Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • [ ] I don't know
    • [ ] Required
    • [ ] Not required because:
  • Changeset (Changeset guidelines)
    • [ ] TODO (before merge)
    • [ ] Changeset included
    • [ ] Changeset not necessary because:
  • Public documentation
    • [ ] TODO (before merge)
    • [ ] Cloudflare docs PR(s):
    • [ ] Documentation not necessary because:

WonDKim avatar Oct 15 '24 03:10 WonDKim

⚠️ No Changeset found

Latest commit: 2ff94a70c37fc9122b584296663354ed753f746a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Oct 15 '24 03:10 changeset-bot[bot]