Advisories for Cargo/Pagefind package

2024

DOM clobbering could escalate to Cross-site Scripting (XSS)

Pagefind initializes its dynamic JavaScript and WebAssembly files relative to the location of the first script you load. This information is gathered by looking up the value of document.currentScript.src. It is possible to "clobber" this lookup with otherwise benign HTML on the page, for example: <img name="currentScript" src="blob:https://xxx.xxx.xxx/ui.js"></img> This will cause document.currentScript.src to resolve as an external domain, which will then be used by Pagefind to load dependencies. This exploit …