{"id":"CVE-2026-22256","aliases":["CVE-2026-22256","GHSA-rjf8-2wcw-f6mp"],"related":[],"kind":"vulnerability","state":"published","title":"Salvo is vulnerable to reflected XSS in the list_html function","summary":"Salvo is a Rust web backend framework. Prior to version 0.88.1, the function list_html generate an file view of a folder which include a render of the current path, in which its inserted in the HTML without proper sanitation, this leads to reflected XSS using the fact that request path is decoded and normalized in the matching stage but not is inserted raw in the html view (current.path), the only constraint here is for the root path (eg. /files in the PoC example) to have a sub directory (e.g common ones styles/scripts/etc…) so that the matching return the list HTML page instead of the Not Found page. This issue has been patched in version 0.88.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Salvo is a Rust web backend framework. Prior to version 0.88.1, the function list_html generate an file view of a folder which include a render of the current path, in which its inserted in the HTML without proper sanitation, this leads to reflected XSS using the fact that request path is decoded and normalized in the matching stage but not is inserted raw in the html view (current.path), the only constraint here is for the root path (eg. /files in the PoC example) to have a sub directory (e.g common ones styles/scripts/etc…) so that the matching return the list HTML page instead of the Not Found page. This issue has been patched in version 0.88.1.","source":"cvelist"},{"lang":"en","text":"# 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…).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Salvo es un framework de backend web de Rust. Antes de la versión 0.88.1, la función list_html generaba una vista de archivo de una carpeta que incluía una renderización de la ruta actual, en la que se inserta en el HTML sin una sanitización adecuada, esto lleva a XSS reflejado utilizando el hecho de que la ruta de la solicitud se decodifica y normaliza en la etapa de coincidencia pero no se inserta en bruto en la vista HTML (current.path), la única restricción aquí es que la ruta raíz (por ejemplo, /files en el ejemplo de PoC) tenga un subdirectorio (por ejemplo, los comunes styles/scripts/etc…) para que la coincidencia devuelva la página HTML de lista en lugar de la página Not Found. Este problema ha sido parcheado en la versión 0.88.1.","source":"nvd"}],"published":"2026-01-08T18:21:57.861Z","modified":"2026-06-17T10:19:38.800Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L","score":8.8,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L","score":8.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L","score":8.8,"rating":"HIGH"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 0.88.1","status":"affected"}],"vendor":"salvo-rs","product":"salvo","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.88.1"}],"ecosystem":"crates.io","package":"salvo","purl":"pkg:cargo/salvo","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.88.1"}],"vendor":"salvo","product":"salvo","cpe":"cpe:2.3:a:salvo:salvo:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/salvo-rs/salvo/security/advisories/GHSA-rjf8-2wcw-f6mp","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/salvo-rs/salvo/blob/16efeba312a274739606ce76366d921768628654/crates/serve-static/src/dir.rs#L593","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22256","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/salvo-rs/salvo","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-01-08T18:39:24.943Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22256","url":"https://www.cve.org/CVERecord?id=CVE-2026-22256","licence":"CVE Terms of Use","modified":"2026-01-08T18:39:58.946Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rjf8-2wcw-f6mp","url":"https://github.com/advisories/GHSA-rjf8-2wcw-f6mp","licence":"CC-BY-4.0","modified":"2026-02-03T03:15:26.215Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22256","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22256","licence":"Public domain","modified":"2026-06-17T10:19:38.800Z"}],"updatedAt":"2026-11-25T22:59:12.681Z","epss":{"score":0.00334,"percentile":0.28701,"date":"2026-12-01T12:00:22.000Z"}}