CVE-2024-45389

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

Published Sep 3, 2024 CVSS 3.1 · 6.4 Medium EPSS < 1% KEV · Not listed
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.

Analysis

No analysis available yet

Remediation

No remediation available yet

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2024-2804 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.
Github GHSA Github GHSA GHSA-gprj-6m2f-j9hx DOM clobbering could escalate to Cross-site Scripting (XSS)
History
Type Values Removed Values Added
First Time appeared Pagefind
Pagefind pagefind
CPEs cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha0:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha1:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha2:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha3:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha4:*:*:*:*:*:*
cpe:2.3:a:pagefind:pagefind:*:*:*:*:*:*:*:*
cpe:2.3:a:pagefind:pagefind:1.1.1:alpha0:*:*:*:*:*:*
cpe:2.3:a:pagefind:pagefind:1.1.1:alpha1:*:*:*:*:*:*
cpe:2.3:a:pagefind:pagefind:1.1.1:alpha2:*:*:*:*:*:*
cpe:2.3:a:pagefind:pagefind:1.1.1:alpha3:*:*:*:*:*:*
cpe:2.3:a:pagefind:pagefind:1.1.1:alpha4:*:*:*:*:*:*
Vendors & Products Pagefind
Pagefind pagefind
Type Values Removed Values Added
CPEs cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha0:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha1:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha2:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha3:*:*:*:*:*:*
cpe:2.3:a:cloudcannon:pagefind:1.1.1:alpha4:*:*:*:*:*:*
Type Values Removed Values Added
CPEs cpe:2.3:a:cloudcannon:pagefinder:*:*:*:*:*:*:*:*
Vendors & Products Cloudcannon pagefinder
Type Values Removed Values Added
First Time appeared Cloudcannon pagefinder
CPEs cpe:2.3:a:cloudcannon:pagefinder:*:*:*:*:*:*:*:*
Vendors & Products Cloudcannon pagefinder
Type Values Removed Values Added
First Time appeared Cloudcannon
Cloudcannon pagefind
CPEs cpe:2.3:a:cloudcannon:pagefind:*:*:*:*:*:*:*:*
Vendors & Products Cloudcannon
Cloudcannon pagefind
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Pagefind DOM clobbering could escalate to Cross-site Scripting (XSS)
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 6.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 3, 2024, 8:03 PM
Reserved
Aug 28, 2024, 8:21 PM
Status
Analyzed
Published
Sep 3, 2024, 8:15 PM
Modified
Jun 17, 2026, 7:54 AM