Pagefind DOM clobbering could escalate to Cross-site Scripting (XSS)
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
Pagefind, a fully static search library, initializes its dynamic JavaScript and WebAssembly files relative to the location of the first script the user loads. This information is gathered by looking up the value of `document.currentScript.src`. Prior to Pagefind version 1.1.1, it is possible to "clobber" this lookup with otherwise benign HTML on the page. 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 a 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 cross-site scripting vector. Pagefind has tightened this resolution in version 1.1.1 by ensuring the source is loaded from a valid script element. There are no reports of this being exploited in the wild via Pagefind.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| CloudCannon | pagefind | before 1.1.1 | 1.1.1 | Patch available | CNA |
| — | pagefind (npm) | before 1.1.1 | 1.1.1 | Patch available | GHSA-gprj-6m2f-j9hx |
| — | @pagefind/default-ui (npm) | before 1.1.1 | 1.1.1 | Patch available | GHSA-gprj-6m2f-j9hx |
| — | @pagefind/modular-ui (npm) | before 1.1.1 | 1.1.1 | Patch available | GHSA-gprj-6m2f-j9hx |
| — | pagefind (crates.io) | before 1.1.1 | 1.1.1 | Patch available | GHSA-gprj-6m2f-j9hx |
- pagefind VendorCloudCannon Affected before 1.1.1 Fixed in 1.1.1 Patch available CNA
- pagefind (npm) Vendor— Affected before 1.1.1 Fixed in 1.1.1 Patch available GHSA-gprj-6m2f-j9hx
- @pagefind/default-ui (npm) Vendor— Affected before 1.1.1 Fixed in 1.1.1 Patch available GHSA-gprj-6m2f-j9hx
- @pagefind/modular-ui (npm) Vendor— Affected before 1.1.1 Fixed in 1.1.1 Patch available GHSA-gprj-6m2f-j9hx
- pagefind (crates.io) Vendor— Affected before 1.1.1 Fixed in 1.1.1 Patch available GHSA-gprj-6m2f-j9hx
CPE configurations NVD · 6
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:pagefind:pagefind:*:*:*:*:*:*:*:* | before 1.1.1 | Vulnerable | Pagefind |
| cpe:2.3:a:pagefind:pagefind:1.1.1:alpha0:*:*:*:*:*:* | 1.1.1 alpha0 | Vulnerable | Pagefind |
| cpe:2.3:a:pagefind:pagefind:1.1.1:alpha1:*:*:*:*:*:* | 1.1.1 alpha1 | Vulnerable | Pagefind |
| cpe:2.3:a:pagefind:pagefind:1.1.1:alpha2:*:*:*:*:*:* | 1.1.1 alpha2 | Vulnerable | Pagefind |
| cpe:2.3:a:pagefind:pagefind:1.1.1:alpha3:*:*:*:*:*:* | 1.1.1 alpha3 | Vulnerable | Pagefind |
| cpe:2.3:a:pagefind:pagefind:1.1.1:alpha4:*:*:*:*:*:* | 1.1.1 alpha4 | Vulnerable | Pagefind |
- cpe:2.3:a:pagefind:pagefind:*:*:*:*:*:*:*:* Versions before 1.1.1 Vulnerable ·Pagefind
- cpe:2.3:a:pagefind:pagefind:1.1.1:alpha0:*:*:*:*:*:* Versions 1.1.1 alpha0 Vulnerable ·Pagefind
- cpe:2.3:a:pagefind:pagefind:1.1.1:alpha1:*:*:*:*:*:* Versions 1.1.1 alpha1 Vulnerable ·Pagefind
- cpe:2.3:a:pagefind:pagefind:1.1.1:alpha2:*:*:*:*:*:* Versions 1.1.1 alpha2 Vulnerable ·Pagefind
- cpe:2.3:a:pagefind:pagefind:1.1.1:alpha3:*:*:*:*:*:* Versions 1.1.1 alpha3 Vulnerable ·Pagefind
- cpe:2.3:a:pagefind:pagefind:1.1.1:alpha4:*:*:*:*:*:* Versions 1.1.1 alpha4 Vulnerable ·Pagefind
Remediation
- Fix · CNA pagefind (CloudCannon) Fixed in 1.1.1
- Fix · GHSA-gprj-6m2f-j9hx pagefind (npm) Fixed in 1.1.1 Advisory →
- Fix · GHSA-gprj-6m2f-j9hx @pagefind/default-ui (npm) Fixed in 1.1.1 Advisory →
- Fix · GHSA-gprj-6m2f-j9hx @pagefind/modular-ui (npm) Fixed in 1.1.1 Advisory →
- Fix · GHSA-gprj-6m2f-j9hx pagefind (crates.io) Fixed in 1.1.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-45389
- 2026-10-03 Alias added: GHSA-gprj-6m2f-j9hx
References
Advisory 2
Sources
- CVE-2024-45389 · CVE Program
- CVE-2024-45389 · NVD
- FIRST EPSS
- GHSA-gprj-6m2f-j9hx · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences