CVE-2026-22256: Salvo Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-rjf8-2wcw-f6mp
CVSS 8.8
CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-22256
GHSA Identifier GHSA-rjf8-2wcw-f6mp
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Salvo
Package Ecosystem crates.io
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (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.

salvo fixed: 0.88.1
Upgrade salvo to 0.88.1
Verify Direct and Transitive Dependencies

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

# Summary The 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. # Details The vulnerable snippet of code is the following: [**dir.rs**](https://github.com/salvo-rs/salvo/blob/16efeba312a274739606ce76366d921768628654/crates/serve-static/src/dir.rs#L593) ```rust // ... fn list_html(... let mut ftxt = format!( r#"<!DOCTYPE html><html><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>{}</title> <style>{}</style></head><body><header><h3>Index of: {}</h3></header><hr/>"#, current.path, HTML_STYLE, header_links(&current.path) ); // ... ``` As seen here `<title>{}</title>` it is inserted unsafely. # PoC https://github.com/user-attachments/assets/92a29a67-547b-40a5-af26-f1b0dd332702 Here 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. `main.rs` ```rust use salvo::prelude::*; use salvo::serve_static::StaticDir; use tokio::fs; #[tokio::main] async fn main() { tracing_subscriber::fmt().init(); fs::create_dir_all("uploads").await.expect("create uploads dir"); let router = Router::new() .push( Router::with_path("files/{**rest_path}") .get(StaticDir::new("uploads").auto_list(true)), ); let acceptor = TcpListener::new("127.0.0.1:5800").bind().await; Server::new(acceptor).serve(router).await; } ``` `Cargo.toml` ```rust [package] name = "salvo-staticdir-xss-poc" version = "0.1.0" edition = "2024" [dependencies] salvo = { version = "0.85.0", features = ["serve-static"] } tokio = { version = "1", features = ["macros", "rt-multi-thread", "fs"] } tracing-subscriber = "0.3" ``` Setup commands: ```bash mkdir uploads mkdir uploads/bla ``` # Impact JavaScript execution, most likely leading to an account takeover, depending on the site's constraint (CSP, etc…).

CVE-2026-22256 Affected Salvo Versions

1 component(s)
Fixed Versions:
0.88.1
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?
CVE-2026-22256 is a security vulnerability in Salvo involving Salvo is vulnerable to reflected XSS in the list_html function under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Salvo versions are affected?
Affected versions include releases prior to 0.88.1 across affected packages: salvo.
What version fixes CVE-2026-22256?
Upgrading to 0.88.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is salvo affected?
Yes, salvo is affected in releases prior to 0.88.1. Upgrade your dependency to 0.88.1 or later.
What is the CVSS score of CVE-2026-22256?
CVE-2026-22256 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L.
What CWE is associated with CVE-2026-22256?
CVE-2026-22256 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check crates.io dependencies for CVE-2026-22256?
Run the dependency tree command: 'inspect dependencies for salvo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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(&current.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"
  }
}