Skip to main content

CVE-2026-27822 — Rust has Critical Stored XSS in rustfs — CVE Details

CRITICAL

Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover

Published February 25, 2026Updated February 25, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.46%). Schedule for your next planned update.

Does your project use an affected rustfs version?

Paste your Cargo.lock to check it for CVE-2026-27822 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

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.

  1. Origin of Credentials: The RustFS Console stores highly sensitive S3 credentials (AccessKey, SecretKey, SessionToken) in the browser's localStorage.
    • File: console/composables/useAuth.ts
    • Evidence: Lines 14 and 18-25 show that credentials are held in useLocalStorage('auth.credentials', {}) and useLocalStorage('auth.permanent', undefined).
  2. 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>.
  3. Same-Origin Vulnerability: RustFS typically hosts the management console and the S3 API on the same origin (e.g., the same IP and port).
  4. 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.

PoC

This 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:

  1. Login to the RustFS Console as an administrator.
  2. Navigate to my-bucket.
  3. Click the "Preview" button for the xss.pdf file.
  4. 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, 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.

Proposed Mitigation

  1. 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.
  2. 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.

Advisory Timeline

  • First published February 25, 2026 (274 days ago).
  • Last revised February 25, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update rustfs to 1.0.0-alpha.83 or later
cargo update -p rustfs --precise 1.0.0-alpha.83

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
rustfs crates.io · Affected: All versions1.0.0-alpha.83

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) 9.0 score means for each attack dimension.

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

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

Frequently Asked Questions

What is CVE-2026-27822?
Rust has Critical Stored XSS in Preview Modal, leading to Administrative Account Takeover. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.0/10).
How do I check if my project is affected by CVE-2026-27822?
CVE-2026-27822 affects rustfs. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-27822 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.0

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
0.46%
EPSS percentile: 31.4

This is a below-median EPSS score — only 31.4% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-v9fg-3cr2-277j

Related CVEs

  • CVE-2025-68926
    CRITICAL

    RustFS has a gRPC Hardcoded Token Authentication Bypass

  • CVE-2026-21862
    HIGH

    RustFS has SourceIp bypass via spoofed X-Forwarded-For/Real-IP headers

  • GHSA-mm2q-qcmx-gw4w
    HIGH

    RustFS: ListServiceAccount authorizes against wrong admin action, enabling cross-user enumeration and root service account takeover

  • CVE-2026-40937
    HIGH

    RustFS: Missing admin authorization on notification target endpoints allows unauthenticated configuration of event webhooks

  • CVE-2025-68705
    HIGH

    RustFS Path Traversal Vulnerability

  • CVE-2026-27607
    HIGH

    RustFS: Missing Post Policy Validation leads to Arbitrary Object Write

  • CVE-2026-22042
    MEDIUM

    RustFS has IAM Incorrect Authorization in ImportIam that Allows Privilege Escalation

  • CVE-2026-22043
    MEDIUM

    RustFS has IAM deny_only Short-Circuit that Allows Privilege Escalation via Service Account Minting

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock