CVE-2026-22256: Salvo Cross-Site Scripting Vulnerability
HIGHCVE-2026-22256 is a HIGH (CVSS 8.8) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Salvo libraries in the crates.io ecosystem. The issue involves salvo is vulnerable to reflected xss in the list_html function. Remediation is available by upgrading affected packages to version 0.88.1.
CVE-2026-22256 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L).
How to Fix CVE-2026-22256
To remediate this vulnerability, upgrade all affected Salvo 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 salvo to 0.88.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for salvo
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-22256, inspect your project dependencies for Salvo:
inspect dependencies for salvo
Analyze the terminal output to locate any version of Salvo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.88.1), 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Salvo, 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-2026-22256 Affected Salvo Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
salvo
|
crates.io |
< 0.88.1
|
0.88.1
|
References
Frequently Asked Questions
What is CVE-2026-22256?
Which Salvo versions are affected?
What version fixes CVE-2026-22256?
Is salvo affected?
What is the CVSS score of CVE-2026-22256?
What CWE is associated with CVE-2026-22256?
How can I check crates.io dependencies for CVE-2026-22256?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rjf8-2wcw-f6mp",
"modified" : "2026-01-08T21:37:17Z",
"published" : "2026-01-08T21:22:18Z",
"aliases" : [ "CVE-2026-22256" ],
"summary" : "Salvo is vulnerable to reflected XSS in the list_html function",
"details" : "# Summary\n\nThe function `list_html` generates an file view of a folder which includes a render of the current path, in which its inserted in the HTML without proper sanitation, leading to reflected XSS. The request path is decoded and normalized in the matching stage but is not inserted raw in the HTML view (current.path). The only constraint here is for the root path (e.g., /files in the PoC example) to have a subdirectory (e. g., common ones like styles/scripts/etc.) so that the matching returns the list HTML page instead of the Not Found page.\n\n# Details\n\nThe vulnerable snippet of code is the following:\n[**dir.rs**](https://github.com/salvo-rs/salvo/blob/16efeba312a274739606ce76366d921768628654/crates/serve-static/src/dir.rs#L593)\n\n```rust\n// ... fn list_html(...\n let mut ftxt = format!(\n r#\"<!DOCTYPE html><html><head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width\">\n <title>{}</title>\n <style>{}</style></head><body><header><h3>Index of: {}</h3></header><hr/>\"#,\n current.path,\n HTML_STYLE,\n header_links(¤t.path)\n );\n// ...\n```\n\nAs seen here `<title>{}</title>` it is inserted unsafely.\n\n# PoC\n\nhttps://github.com/user-attachments/assets/92a29a67-547b-40a5-af26-f1b0dd332702\n\nHere is the example app, note this doesn’t need an upload feature (e.g to the other reported vulnerability), only the sub-folder is required.\n\n`main.rs`\n```rust\nuse salvo::prelude::*;\nuse salvo::serve_static::StaticDir;\nuse tokio::fs;\n\n#[tokio::main]\nasync fn main() {\n tracing_subscriber::fmt().init();\n fs::create_dir_all(\"uploads\").await.expect(\"create uploads dir\");\n\n let router = Router::new()\n .push(\n Router::with_path(\"files/{**rest_path}\")\n .get(StaticDir::new(\"uploads\").auto_list(true)),\n );\n\n let acceptor = TcpListener::new(\"127.0.0.1:5800\").bind().await;\n Server::new(acceptor).serve(router).await;\n}\n```\n\n`Cargo.toml`\n```rust\n[package]\nname = \"salvo-staticdir-xss-poc\"\nversion = \"0.1.0\"\nedition = \"2024\"\n\n[dependencies]\nsalvo = { version = \"0.85.0\", features = [\"serve-static\"] }\ntokio = { version = \"1\", features = [\"macros\", \"rt-multi-thread\", \"fs\"] }\ntracing-subscriber = \"0.3\"\n```\n\nSetup commands:\n```bash\nmkdir uploads\nmkdir uploads/bla\n```\n\n# Impact\n\nJavaScript execution, most likely leading to an account takeover, depending on the site's constraint (CSP, etc…).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "salvo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.88.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/salvo-rs/salvo/security/advisories/GHSA-rjf8-2wcw-f6mp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22256"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/salvo-rs/salvo"
}, {
"type" : "WEB",
"url" : "https://github.com/salvo-rs/salvo/blob/16efeba312a274739606ce76366d921768628654/crates/serve-static/src/dir.rs#L593"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-01-08T21:22:18Z",
"nvd_published_at" : "2026-01-08T19:16:00Z"
}
}