# CVE-2024-45389: Pagefind DOM clobbering could escalate to Cross-site Scripting (XSS)

- Severity: Medium 6.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.42%, higher than 38% of CVEs (2026-12-01)
- Published: 2024-09-03T19:30:15.699Z
- Modified: 2026-06-17T07:54:07.203Z
- Also known as: GHSA-gprj-6m2f-j9hx
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- CloudCannon pagefind: < 1.1.1; before 1.1.1
- pagefind (npm): before 1.1.1
- @pagefind/default-ui (npm): before 1.1.1
- @pagefind/modular-ui (npm): before 1.1.1
- pagefind (crates.io): before 1.1.1
- pagefind pagefind: before 1.1.1; 1.1.1

## Every score

- GitHub_M: CVSS:3.1 6.4 Medium `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H`
- GitHub: CVSS:3.1 6.4 Medium `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/CloudCannon/pagefind/security/advisories/GHSA-gprj-6m2f-j9hx> (vendor-advisory, web)
- <https://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986> (not-applicable, web)
- <https://github.com/CloudCannon/pagefind/commit/14ec96864eabaf1d7d809d5da0186a8856261eeb> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-45389> (advisory)
- <https://github.com/CloudCannon/pagefind> (package)

## Sources

- CVE List: [CVE-2024-45389](https://www.cve.org/CVERecord?id=CVE-2024-45389), CVE Terms of Use, modified 2024-09-03
- GitHub Advisory Database: [GHSA-gprj-6m2f-j9hx](https://github.com/advisories/GHSA-gprj-6m2f-j9hx), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2024-45389](https://nvd.nist.gov/vuln/detail/CVE-2024-45389), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-45389 · Whole record: https://cve.day/CVE-2024-45389.json · Rebuilt by cve.day 2026-11-25T22:58:45.022Z
