9.1critical
Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover
- Severity
- 9.1critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 5.17% (higher than 92% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-v9fg-3cr2-277j
Description
RustFS is a distributed object storage system built in Rust. Prior to version 1.0.0-alpha.83, a Stored Cross-Site Scripting (XSS) vulnerability in the RustFS Console allows an attacker to execute arbitrary JavaScript in the context of the management console. By bypassing the PDF preview logic, an attacker can steal administrator credentials from `localStorage`, leading to full account takeover and system compromise. Version 1.0.0-alpha.83 fixes the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rustfs rustfs | < 1.0.0-alpha.83, 1.0.0 | CVE List, NVD |
| rustfs (crates.io) | before 1.0.0-alpha.83 | GitHub Advisory Database |
All scores
| GitHub_M | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H |
| GitHub | 9.0critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H |
| NVD | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
RustFS is a distributed object storage system built in Rust. Prior to version 1.0.0-alpha.83, a Stored Cross-Site Scripting (XSS) vulnerability in the RustFS Console allows an attacker to execute arbitrary JavaScript in the context of the management console. By bypassing the PDF preview logic, an attacker can steal administrator credentials from `localStorage`, leading to full account takeover and system compromise. Version 1.0.0-alpha.83 fixes the issue.
GitHub Advisory Database
Summary
A Stored Cross-Site Scripting (XSS) vulnerability in the RustFS Console allows an attacker to execute arbitrary JavaScript in the context of the management console. By bypassing the PDF preview logic, an attacker can steal administrator credentials from localStorage, leading to full account takeover and system compromise.
Details
The vulnerability exists due to improper validation of the response content type during the file preview process and a lack of origin separation between the S3 object delivery and the management console.
- Origin of Credentials: The RustFS Console stores highly sensitive S3 credentials (AccessKey, SecretKey, SessionToken) in the browser's
localStorage. - Insecure Preview Implementation: In
console/components/object/preview-modal.vue, the application identifies a PDF file based on its extension or metadata and renders it using an<iframe>. - Same-Origin Vulnerability: RustFS typically hosts the management console and the S3 API on the same origin (e.g., the same IP and port).
- Bypass Attack: An attacker can upload a file named
xss.pdfbut set itsContent-Typemetadata totext/html. Because theiframeis hosted on the same origin as the console, the executed script has unrestricted access to the parent window'slocalStorage.
PoC
CleanShot 2026-02-01 at 18 36 54@2xThis PoC demonstrates how to steal a victim's administrative credentials by tricking them into previewing a malicious file.
1. Create the malicious payload (xss.html):
<script>
alert('XSS Success!\nLocalStorage Data: ' + JSON.stringify(window.parent.localStorage));
</script>
2. Setup the environment and upload the payload:
# 1. Create a target bucket
mc mb rustfs/my-bucket
# 2. Upload the HTML file as a PDF with HTML content type
mc cp xss.html rustfs/my-bucket/xss.pdf --attr "Content-Type=text/html"
3. Trigger the vulnerability:
- Login to the RustFS Console as an administrator.
- Navigate to
my-bucket. - Click the "Preview" button for the
xss.pdffile. - The JavaScript executes, demonstrating access to the administrative session data.
Impact
- Character: Stored Cross-Site Scripting (XSS).
- Target: System Administrators using the Console.
- Result: Full Account Takeover (ATO). An attacker gains the victim's
AccessKeyId,SecretAccessKey, andSessionToken. This allows the attacker to perform any administrative action, including deleting data, creating backdoors, or downloading the entire filesystem via the S3 API.
Proposed Mitigation
- Origin Separation: Implement a dedicated domain for data delivery (e.g.,
*.data.rustfs.io) that is different from the console domain. This leverages the Same-Origin Policy (SOP) to isolate user-uploaded content. - Security Headers: Implement strict security headers in the backend:
Content-Security-Policy (CSP): Disallow inline scripts and restrict script execution.X-Content-Type-Options: nosniff: Prevent browsers from sniffing and executing content that differs from the declared type.
NVD (es)
RustFS es un sistema de almacenamiento de objetos distribuido construido en Rust. Antes de la versión 1.0.0-alpha.83, una vulnerabilidad de cross-site scripting (XSS) almacenado en la Consola de RustFS permite a un atacante ejecutar JavaScript arbitrario en el contexto de la consola de gestión. Al eludir la lógica de previsualización de PDF, un atacante puede robar credenciales de administrador de 'localStorage', lo que lleva a una toma de control total de la cuenta y a un compromiso del sistema. La versión 1.0.0-alpha.83 corrige el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27822 changed 2026-02-25 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-v9fg-3cr2-277j changed 2026-02-25 | CC-BY-4.0 |
| NVD | CVE-2026-27822 changed 2026-06-17 | Public domain |