CVE-2024-45389 json
Pagefind DOM clobbering could escalate to Cross-site Scripting (XSS)
published 2y ago modified 4mo ago also EUVD-2024-2804 , GHSA-gprj-6m2f-j9hx
- cvss
- 6.4
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 36%
- public exploits
- 0
- none known
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.
Patch / fix
- npm pagefind 1.1.1
- npm @pagefind/default-ui 1.1.1
- npm @pagefind/modular-ui 1.1.1
- crates.io pagefind 1.1.1
- CloudCannon pagefind 1.1.1
Is CVE-2024-45389 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2y ago
Exploit prediction
0.42% chance of exploitation in the next 30 days, higher than 36% of all scored CVEs (FIRST EPSS, 2026-11-11).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.4 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H |
| GitHub | 3.1 | 6.4 | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H |
| NVD | 3.1 | 5.4 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | pagefind | <1.1.1 |
1.1.1 |
| npm | @pagefind/default-ui | <1.1.1 |
1.1.1 |
| npm | @pagefind/modular-ui | <1.1.1 |
1.1.1 |
| crates.io | pagefind | <1.1.1 |
1.1.1 |
Affected products
- CloudCannon pagefind
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/CloudCannon/pagefind/commit/14ec96864eabaf1d7d809d5da0186a8856261eeb
web, patch
-
github.com
/CloudCannon/pagefind/security/advisories/GHSA-gprj-6m2f-j9hx
web, vendor-advisory
-
github.com
/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986
web, not-applicable
-
nvd.nist.gov
/vuln/detail/CVE-2024-45389
advisory
-
github.com
/CloudCannon/pagefind
package
-
github.com
/Pagefind/pagefind/security/advisories/GHSA-gprj-6m2f-j9hx
advisory
Sources
- CVE List CVE-2024-45389
- GitHub Advisory GHSA-gprj-6m2f-j9hx
- NVD CVE-2024-45389
- Maintainer advisory GHSA-gprj-6m2f-j9hx
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.
The maintainers of Pagefind/pagefind published their own advisory on GitHub. Reviewed sources take precedence over it.