CVE-2024-45389: cloudcannon pagefind Cross-site Scripting
Vulnerability summary
CVE-2024-45389 is a medium (CVSS 6.4) Cross-site Scripting vulnerability in cloudcannon pagefind. EPSS estimates a 0.42% chance of exploitation in the next 30 days, higher than 35% of scored vulnerabilities.
Advisory lineage
Upstream 0 · Downstream 0 · Related 1Timeline
- 03-09-2024PublishedVulnerability first disclosed.
- 03-09-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
6 scores · 4 sources · 2 versions- OSV · Crates.ioEcosystem advisory · calculated6.1MediumCVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N
- OSV · NpmEcosystem advisory · calculated6.4MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
- OSV · Crates.ioEcosystem advisory · calculated6.4MediumCVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
- NVDNIST5.4MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:NDiffers
EPSS trend
Probability
0.42%
Chance of exploitation in the next 30 days
Percentile
35%
Versus all other CVEs
30-day change
0.00 pp
From 0.42% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
@pagefind2 products
- default-ui< 1.1.1
- modular-ui< 1.1.1
Cloudcannon1 product
- pagefind< 1.1.1
Crates.Io1 product
- pagefind< 1.1.1
Npm1 product
- pagefind< 1.1.1
Pagefind1 product
- pagefind< 1.1.1 | 1.1.1:alpha0 | 1.1.1:alpha1 | 1.1.1:alpha2 | 1.1.1:alpha3 | 1.1.1:alpha4
5 vendors · 6 products
References
5 links- github.com/CloudCannon/pagefind/security/advisories/GHSA-gprj-6m2f-j9hxX Refsource CONFIRMWEBVendor Advisory
- github.com/CloudCannon/pagefind/commit/14ec96864eabaf1d7d809d5da0186a8856261eebX Refsource MISCWEBPatch