{"answers":{"affected":"2 open source packages ship an affected version, including static-web-server.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-32966 exists.","fix":"Upgrade static-web-server to 2.30.0 or later.","what":"CVE-2024-32966 is a medium-severity cross-site scripting vulnerability in static-web-server, published on 1 May 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-32966 and fix it if it is affected.\n\nWhat it is: CVE-2024-32966 is a medium-severity cross-site scripting vulnerability in static-web-server, published on 1 May 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-32966 exists.\n\nAffected packages and fixed versions:\n- static-web-server (crates.io): affected all versions; fixed in 2.30.0\n- static-web-server (crates.io): affected all versions; fixed in 2.30.0\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-32966/ (Markdown: https://insights.sbomify.com/CVE-2024-32966/index.md)","id":"CVE-2024-32966","markdown":"https://insights.sbomify.com/CVE-2024-32966/index.md","name":"CVE-2024-32966","record":{"aliases":["GHSA-rwfq-v4hq-h7fg"],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["code_execution","security_bypass"],"network_reachable":"yes","non_default_config":true,"product_category":"Static web server","requires_auth":"none","summary":"Attackers can execute arbitrary JavaScript in the victim's browser via malicious file names when directory listings are enabled.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":5.8,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-80","name":"Improper Neutralization of Script-Related HTML Tags in a Web Page"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"Static Web Server (SWS) is a tiny and fast production-ready web server suitable to serve static web files or assets. In affected versions if directory listings are enabled for a directory that an untrusted user has upload privileges for, a malicious file name like `\u003cimg src=x onerror=alert(1)\u003e.txt` will allow JavaScript code execution in the context of the web server’s domain. SWS generally does not perform escaping of HTML entities on any values inserted in the directory listing. At the very least `file_name` and `current_path` could contain malicious data however. `file_uri` could also be malicious but the relevant scenarios seem to be all caught by hyper. For any web server that allow users to upload files or create directories under a name of their choosing this becomes a stored Cross-site Scripting vulnerability. Users are advised to upgrade. There are no known workarounds for this vulnerability.","ecosystems":["crates.io"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Stored Cross-site Scripting in directory listings via file names in static-web-server","id":"CVE-2024-32966","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":2,"n_references":1,"next":{"headline":"Zitadel exposes internal database user name and host information","id":"CVE-2024-32967"},"packages":[{"ecosystem":"crates.io","fixed":["2.30.0"],"introduced":["0"],"last_affected":[],"package":"static-web-server","purl":null,"source":"GHSA-rwfq-v4hq-h7fg"},{"ecosystem":"crates.io","fixed":["2.30.0"],"introduced":["0"],"last_affected":[],"package":"static-web-server","purl":"pkg:cargo/static-web-server","source":"GHSA-rwfq-v4hq-h7fg"}],"prev":{"headline":"ssrf vulnerability in lobe-chat","id":"CVE-2024-32965"},"products":["static-web-server"],"published":"2024-05-01","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":"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-02","vendors":["static-web-server"]},"summary":"Attackers can execute arbitrary JavaScript in the victim's browser via malicious file names when directory listings are enabled.","url":"https://insights.sbomify.com/CVE-2024-32966/"}