{"answers":{"affected":"2 open source packages ship an affected version, including livewire/livewire. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21504 exists.","fix":"Upgrade livewire/livewire to 3.4.9 or later.","what":"CVE-2024-21504 is a medium-severity cross-site scripting vulnerability in livewire/livewire, published on 19 Mar 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2024-21504 and fix it if it is affected.\n\nWhat it is: CVE-2024-21504 is a medium-severity cross-site scripting vulnerability in livewire/livewire, published on 19 Mar 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21504 exists.\n\nAffected packages and fixed versions:\n- livewire/livewire (Packagist): affected from 3.3.5; fixed in 3.4.9\n- livewire/livewire (Packagist): affected from 3.3.5; fixed in 3.4.9\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-21504/ (Markdown: https://insights.sbomify.com/CVE-2024-21504/index.md)","id":"CVE-2024-21504","markdown":"https://insights.sbomify.com/CVE-2024-21504/index.md","name":"CVE-2024-21504","record":{"aliases":["GHSA-389c-cf87-qmwj"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Livewire PHP library","requires_auth":"none","summary":"An attacker can inject malicious HTML into a user's browser session via crafted links in Livewire applications using the Url property.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"snyk","cpe":[{"product":"livewire","vendor":"laravel"}],"cvss":{"score":6.1,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"Versions of the package livewire/livewire from 3.3.5 and before 3.4.9 are vulnerable to Cross-site Scripting (XSS) when a page uses [Url] for a property. An attacker can inject HTML code in the context of the user's browser session by crafting a malicious link and convincing the user to click on it.","ecosystems":["Packagist"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Cross-site Scripting in livewire/livewire","id":"CVE-2024-21504","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":2,"n_references":4,"next":{"headline":"web3-utils Prototype Pollution vulnerability","id":"CVE-2024-21505"},"packages":[{"ecosystem":"Packagist","fixed":["3.4.9"],"introduced":["3.3.5"],"last_affected":[],"package":"livewire/livewire","purl":null,"source":"GHSA-389c-cf87-qmwj"},{"ecosystem":"Packagist","fixed":["3.4.9"],"introduced":["3.3.5"],"last_affected":[],"package":"livewire/livewire","purl":"pkg:composer/livewire/livewire","source":"GHSA-389c-cf87-qmwj"}],"prev":{"headline":"Black vulnerable to Regular Expression Denial of Service (ReDoS)","id":"CVE-2024-21503"},"products":["livewire/livewire"],"published":"2024-03-19","related":[{"cvss_score":9.2,"headline":"Laravel Livewire Code Injection","id":"CVE-2025-54068","kev_date_added":"2026-03-20","published":"2025-07-17"},{"cvss_score":8.8,"headline":"Cross-site request forgery in n/a","id":"CVE-2024-22859","kev_date_added":null,"published":"2024-02-01"},{"cvss_score":7.7,"headline":"Livewire Remote Code Execution (RCE) on File Uploads","id":"CVE-2024-47823","kev_date_added":null,"published":"2024-10-08"}],"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-08-27","vendors":["n/a"]},"summary":"An attacker can inject malicious HTML into a user's browser session via crafted links in Livewire applications using the Url property.","url":"https://insights.sbomify.com/CVE-2024-21504/"}