Closed lamcodeofpwnosec closed 4 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
lexical | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 23, 2024 8:47am |
lexical-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 23, 2024 8:47am |
Path | Size |
---|---|
lexical - cjs | 29.94 KB (0%) |
lexical - esm | 29.78 KB (0%) |
@lexical/rich-text - cjs | 38.6 KB (0%) |
@lexical/rich-text - esm | 31.64 KB (0%) |
@lexical/plain-text - cjs | 37.2 KB (0%) |
@lexical/plain-text - esm | 29 KB (0%) |
@lexical/react - cjs | 40.34 KB (0%) |
@lexical/react - esm | 33 KB (0%) |
We discovered a DOM Clobbering vulnerability in rollup when bundling scripts that use
import.meta.url
or with plugins that emit and reference asset files from code incjs/umd/iife
format. The DOM Clobbering gadget can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitizedname
attribute) are present.Backgrounds 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:
Gadget found in
rollup
We have identified a DOM Clobbering vulnerability inrollup
bundled scripts, particularly when the scripts usesimport.meta
and set output in format ofcjs/umd/iife
. In such cases,rollup
replaces meta property with the URL retrieved fromdocument.currentScript
.PoC
Considering a website that contains the following main.js script, the devloper decides to use the rollup to bundle up the program: rollup main.js --format cjs --file bundle.js.
The output
bundle.js
is shown in the following code snippet.Patch Patching the following two functions with type checking would be effective mitigations against DOM Clobbering attack.
Impact
This vulnerability can result in cross-site scripting (XSS) attacks on websites that include rollup-bundled files (configured with an output format of
cjs
,iife
, orumd
and useimport.meta
) and allow users to inject certain scriptless HTML tags without properly sanitizing thename
orid
attributes.CVE-2024-47068 CWE-79