Loading...
Skip to main content

CVE-2026-22256 — Salvo is vulnerable to reflected XSS in salvo —...

HIGH

Salvo is vulnerable to reflected XSS in the list_html function

Published January 8, 2026Updated February 3, 2026Source: osv

Summary

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

Advisory Timeline

  • First published January 8, 2026 (277 days ago).
  • Last revised February 3, 2026 — 25 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update salvo to 0.88.1 or later
cargo update -p salvo --precise 0.88.1

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: crates.io (1).

PackageEcosystemAffectedFixed In
salvo
crates.io
All versions0.88.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
Low
Availability
Low

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L

Frequently Asked Questions

What is CVE-2026-22256?
Salvo is vulnerable to reflected XSS in the list_html function This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
How do I check if my project is affected by CVE-2026-22256?
CVE-2026-22256 affects salvo. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-22256 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.8

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-rjf8-2wcw-f6mp

Related CVEs

  • CVE-2026-22257
    HIGH

    Salvo is vulnerable to stored XSS in the list_html function by uploading files with malicious names

  • CVE-2026-93657
    HIGH

    hickory-resolver: Resolver::lookup() and Resolver::lookup_ip() APIs obscure DNSSEC validation failures

  • CVE-2026-18140
    HIGH

    aws-smithy-json: Uncontrolled recursion in the aws-smithy-json unknown-key skip path allows unauthenticated remote denial of service in smithy-rs generated servers

  • CVE-2026-33242
    HIGH

    Salvo has a Path Traversal in salvo-proxy::encode_url_path allows API Gateway Bypass

  • CVE-2026-33241
    HIGH

    Salvo Affected by Denial of Service via Unbounded Memory Allocation in Form Data Parsing

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies