Loading...
Skip to main content

CVE-2024-45389 — Vulnerability in @pagefind/modular-ui — CVE Details

MEDIUM

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

Published September 3, 2024Updated February 4, 2026Source: osv

Summary

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: ```html <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 would only work in the case that an attacker could inject HTML to your live, hosted, website. In these cases, this would act as a way to escalate the privilege available to an attacker. This assumes they have the ability to add some elements to the page (for example, `img` tags with a `name` attribute), but not others, as adding a `script` to the page would itself be the XSS vector. Pagefind has tightened this resolution by ensuring the source is loaded from a valid script element. There are no reports of this being exploited in the wild via Pagefind. ### Original Report If an attacker can inject benign html, such as: `<img name="currentScript" src="blob:https://xxx.xxx.xxx/ui.js"></img>` they can clobber `document.currentScript.src` leading to XSS in your library. Here is the same attack on webpack that was accepted: https://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986

Advisory Timeline

  • First published September 3, 2024 (769 days ago).
  • Last revised February 4, 2026 — 518 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update @pagefind/modular-ui to 1.1.1 or later
npm install @pagefind/modular-ui@1.1.1
npm
Update @pagefind/default-ui to 1.1.1 or later
npm install @pagefind/default-ui@1.1.1
npm
Update pagefind to 1.1.1 or later
npm install pagefind@1.1.1
Cargo
Update pagefind to 1.1.1 or later
cargo update -p pagefind --precise 1.1.1

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 2 ecosystems: npm (3), crates.io (1).

PackageEcosystemAffectedFixed In
@pagefind/modular-ui
npm
All versions1.1.1
@pagefind/default-ui
npm
All versions1.1.1
pagefind
npm
All versions1.1.1
pagefind
crates.io
All versions1.1.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.4 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
High

CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H

Frequently Asked Questions

What is CVE-2024-45389?
DOM clobbering could escalate to Cross-site Scripting (XSS) This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.4/10).
How do I check if my project is affected by CVE-2024-45389?
CVE-2024-45389 affects @pagefind/modular-ui, @pagefind/default-ui and pagefind. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-45389 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.4

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-gprj-6m2f-j9hx

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies