{"answers":{"affected":"8 open source packages ship an affected version, including pagefind, @pagefind/default-ui and @pagefind/modular-ui. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45389 exists.","fix":"Upgrade pagefind to 1.1.1 or later.","what":"CVE-2024-45389 is a medium-severity cross-site scripting vulnerability in CloudCannon pagefind, published on 3 Sep 2024. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-45389 and fix it if it is affected.\n\nWhat it is: CVE-2024-45389 is a medium-severity cross-site scripting vulnerability in CloudCannon pagefind, published on 3 Sep 2024. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45389 exists.\n\nAffected packages and fixed versions:\n- pagefind (crates.io): affected all versions; fixed in 1.1.1\n- pagefind (crates.io): affected all versions; fixed in 1.1.1\n- pagefind (npm): affected all versions; fixed in 1.1.1\n- pagefind (npm): affected all versions; fixed in 1.1.1\n- @pagefind/default-ui (npm): affected all versions; fixed in 1.1.1\n- @pagefind/default-ui (npm): affected all versions; fixed in 1.1.1\n- @pagefind/modular-ui (npm): affected all versions; fixed in 1.1.1\n- @pagefind/modular-ui (npm): affected all versions; fixed in 1.1.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-45389/ (Markdown: https://insights.sbomify.com/CVE-2024-45389/index.md)","id":"CVE-2024-45389","markdown":"https://insights.sbomify.com/CVE-2024-45389/index.md","name":"CVE-2024-45389","record":{"aliases":["GHSA-gprj-6m2f-j9hx"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Static search library","requires_auth":"low_privilege","summary":"Attacker with HTML injection capability can escalate to XSS by clobbering script source resolution in Pagefind static search library.","user_interaction":"not_required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"pagefind","vendor":"pagefind"}],"cvss":{"score":6.4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"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.","ecosystems":["crates.io","npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Pagefind DOM clobbering could escalate to Cross-site Scripting (XSS)","id":"CVE-2024-45389","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":8,"n_references":3,"next":{"headline":"@blakeembrey/template vulnerable to code injection when attacker controls template input","id":"CVE-2024-45390"},"packages":[{"ecosystem":"crates.io","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pagefind","purl":null,"source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"crates.io","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pagefind","purl":"pkg:cargo/pagefind","source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"npm","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"@pagefind/default-ui","purl":null,"source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"npm","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"@pagefind/default-ui","purl":"pkg:npm/%40pagefind/default-ui","source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"npm","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"@pagefind/modular-ui","purl":null,"source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"npm","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"@pagefind/modular-ui","purl":"pkg:npm/%40pagefind/modular-ui","source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"npm","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pagefind","purl":null,"source":"GHSA-gprj-6m2f-j9hx"},{"ecosystem":"npm","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pagefind","purl":"pkg:npm/pagefind","source":"GHSA-gprj-6m2f-j9hx"}],"prev":{"headline":"Arbitrary file read in the `/api/v2/simulation` endpoint in hoverfly (`GHSL-2023-274`)","id":"CVE-2024-45388"},"products":["pagefind"],"published":"2024-09-03","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-09-03","vendors":["CloudCannon"]},"summary":"Attacker with HTML injection capability can escalate to XSS by clobbering script source resolution in Pagefind static search library.","url":"https://insights.sbomify.com/CVE-2024-45389/"}