CVE-2024-45389

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

6.4 medium EPSS 0.42%

Published 3 Sep 2024 Updated 3 Sep 2024 CNA: GitHub_M

Check your servers for CVE-2024-45389

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-45389 affects pagefind, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

6.4 medium CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality low, integrity low, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.42%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 38.3% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 3 Sep 2024):

Exploitation
poc: a proof of concept is public
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Weakness

  • CWE-79 Improper Neutralization of Input During Web Page Generation

Affected products

As the CNA lists them.

ProductVersions
pagefind
affected < 1.1.1

Is my server affected?

Find the installed version of pagefind and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i pagefind
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2024-45389 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2024-45389

RHEL, Rocky, Alma, Fedora

rpm -q pagefind
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2024-45389

Alpine

apk list --installed | grep -i pagefind

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2024-45389
trivy image --scanners vuln IMAGE | grep CVE-2024-45389

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2024-45389 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.