CVE-2024-32966: Static web server Cross-Site Scripting Vulnerability
MODERATECVE-2024-32966 is a MODERATE (CVSS 5.8) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Static web server libraries in the crates.io ecosystem. The issue involves static-web-server vulnerable to stored cross-site scripting in directory listings via file names. Remediation is available by upgrading affected packages to version 2.30.0.
CVE-2024-32966 at a Glance
Security Impact
CVSS: 5.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L).
How to Fix CVE-2024-32966
To remediate this vulnerability, upgrade all affected Static web server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade static-web-server to 2.30.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for static-web-server
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-32966, inspect your project dependencies for Static web server:
inspect dependencies for static-web-server
Analyze the terminal output to locate any version of Static web server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.30.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Static web server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-32966 Affected Static web server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
static-web-server
|
crates.io |
< 2.30.0
|
2.30.0
|
References
Frequently Asked Questions
What is CVE-2024-32966?
Which Static web server versions are affected?
What version fixes CVE-2024-32966?
Is static-web-server affected?
What is the CVSS score of CVE-2024-32966?
What CWE is associated with CVE-2024-32966?
How can I check crates.io dependencies for CVE-2024-32966?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rwfq-v4hq-h7fg",
"modified" : "2024-05-01T16:39:24Z",
"published" : "2024-05-01T16:39:24Z",
"aliases" : [ "CVE-2024-32966" ],
"summary" : "static-web-server vulnerable to stored Cross-site Scripting in directory listings via file names",
"details" : "### Summary\nIf directory listings are enabled for a directory that an untrusted user has upload privileges for, a malicious file name like `<img src=x onerror=alert(1)>.txt` will allow JavaScript code execution in the context of the web server’s domain.\n\n### Details\nSWS 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.\n\n### Impact\nFor any web server that allow users to upload files or create directories under a name of their choosing this becomes a stored XSS vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "static-web-server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.30.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/static-web-server/static-web-server/security/advisories/GHSA-rwfq-v4hq-h7fg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-32966"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/static-web-server/static-web-server"
}, {
"type" : "WEB",
"url" : "https://github.com/static-web-server/static-web-server/releases/tag/v2.30.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79", "CWE-80" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-01T16:39:24Z",
"nvd_published_at" : "2024-05-01T06:15:21Z"
}
}