CVE-2026-27822: Rustfs Cross-Site Scripting Vulnerability
CRITICALCVE-2026-27822 is a CRITICAL (CVSS 9.0) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Rustfs libraries in the crates.io ecosystem. The issue involves rust has critical stored xss in preview modal, leading to administrative account takeover. Remediation is available by upgrading affected packages to version 1.0.0-alpha.83.
CVE-2026-27822 at a Glance
Security Impact
CVSS: 9.0
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2026-27822
To remediate this vulnerability, upgrade all affected Rustfs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade rustfs to 1.0.0-alpha.83
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for rustfs
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-27822, inspect your project dependencies for Rustfs:
inspect dependencies for rustfs
Analyze the terminal output to locate any version of Rustfs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-alpha.83), 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 Rustfs, 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
CVE-2026-27822 Affected Rustfs Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
rustfs
|
crates.io |
< 1.0.0-alpha.83
|
1.0.0-alpha.83
|
References
Frequently Asked Questions
What is CVE-2026-27822?
Which Rustfs versions are affected?
What version fixes CVE-2026-27822?
Is rustfs affected?
What is the CVSS score of CVE-2026-27822?
What CWE is associated with CVE-2026-27822?
How can I check crates.io dependencies for CVE-2026-27822?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v9fg-3cr2-277j",
"modified" : "2026-02-25T23:00:18Z",
"published" : "2026-02-25T23:00:18Z",
"aliases" : [ "CVE-2026-27822" ],
"summary" : "Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover",
"details" : "### Summary\nA 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.\n\n### Details\nThe 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.\n\n1. **Origin of Credentials**: The RustFS Console stores highly sensitive S3 credentials (AccessKey, SecretKey, SessionToken) in the browser's `localStorage`.\n - **File**: `console/composables/useAuth.ts`\n - **Evidence**: [Lines 14](https://github.com/rustfs/console/blob/c2bd75adacad0d0182c32d5271e8ff150c4a02db/composables/useAuth.ts#L14) and [18-25](https://github.com/rustfs/console/blob/c2bd75adacad0d0182c32d5271e8ff150c4a02db/composables/useAuth.ts#L18-L25) show that credentials are held in `useLocalStorage('auth.credentials', {})` and `useLocalStorage('auth.permanent', undefined)`.\n2. **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>`](https://github.com/rustfs/console/blob/6ab024be1c49bc9549a24ed1d09348f5e7039876/components/object/preview-modal.vue#L10).\n3. **Same-Origin Vulnerability**: RustFS typically hosts the management console and the S3 API on the same origin (e.g., the same IP and port). \n4. **Bypass Attack**: An attacker can upload a file named `xss.pdf` but set its `Content-Type` metadata to `text/html`. Because the `iframe` is hosted on the same origin as the console, the executed script has unrestricted access to the parent window's `localStorage`.\n\n### PoC\n<img width=\"6006\" height=\"3096\" alt=\"CleanShot 2026-02-01 at 18 36 54@2x\" src=\"https://github.com/user-attachments/assets/f2f5dae6-1e19-4133-9a69-f7d8ec604dad\" />\n\nThis PoC demonstrates how to steal a victim's administrative credentials by tricking them into previewing a malicious file.\n\n**1. Create the malicious payload (`xss.html`):**\n```html\n<script>\n alert('XSS Success!\\nLocalStorage Data: ' + JSON.stringify(window.parent.localStorage));\n</script>\n```\n\n**2. Setup the environment and upload the payload:**\n```bash\n# 1. Create a target bucket\nmc mb rustfs/my-bucket\n\n# 2. Upload the HTML file as a PDF with HTML content type\nmc cp xss.html rustfs/my-bucket/xss.pdf --attr \"Content-Type=text/html\"\n```\n\n**3. Trigger the vulnerability:**\n1. Login to the RustFS Console as an administrator.\n2. Navigate to `my-bucket`.\n3. Click the \"Preview\" button for the `xss.pdf` file.\n4. The JavaScript executes, demonstrating access to the administrative session data.\n\n### Impact\n- **Character**: Stored Cross-Site Scripting (XSS).\n- **Target**: System Administrators using the Console.\n- **Result**: Full Account Takeover (ATO). An attacker gains the victim's `AccessKeyId`, `SecretAccessKey`, and `SessionToken`. This allows the attacker to perform any administrative action, including deleting data, creating backdoors, or downloading the entire filesystem via the S3 API.\n\n### Proposed Mitigation\n1. **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.\n2. **Security Headers**: Implement strict security headers in the backend:\n - `Content-Security-Policy (CSP)`: Disallow inline scripts and restrict script execution.\n - `X-Content-Type-Options: nosniff`: Prevent browsers from sniffing and executing content that differs from the declared type.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "rustfs"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.0-alpha.83"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/rustfs/rustfs/security/advisories/GHSA-v9fg-3cr2-277j"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27822"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rustfs/rustfs"
}, {
"type" : "WEB",
"url" : "https://github.com/rustfs/rustfs/releases/tag/1.0.0-alpha.83"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-02-25T23:00:18Z",
"nvd_published_at" : "2026-02-25T03:16:07Z"
}
}