CVE-2026-27822

CVE-2026-27822 is a critical-severity cross-site scripting (XSS) vulnerability in rustfs (rust), affecting versions < 1.0.0-alpha.83. It is fixed in 1.0.0-alpha.83.

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.

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.

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.

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2026-27822 has a CVSS score of 9.0 (Critical). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.0.0-alpha.83); upgrading removes the vulnerable code path.

Affected versions

rustfs (< 1.0.0-alpha.83)

Security releases

rustfs → 1.0.0-alpha.83 (rust)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade rustfs to 1.0.0-alpha.83 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-27822? CVE-2026-27822 is a critical-severity cross-site scripting (XSS) vulnerability in rustfs (rust), affecting versions < 1.0.0-alpha.83. It is fixed in 1.0.0-alpha.83. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2026-27822? CVE-2026-27822 has a CVSS score of 9.0 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of rustfs are affected by CVE-2026-27822? rustfs (rust) versions < 1.0.0-alpha.83 is affected.
  4. Is there a fix for CVE-2026-27822? Yes. CVE-2026-27822 is fixed in 1.0.0-alpha.83. Upgrade to this version or later.
  5. Is CVE-2026-27822 exploitable, and should I be worried? Whether CVE-2026-27822 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-27822 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-27822? Upgrade rustfs to 1.0.0-alpha.83 or later.

Other vulnerabilities in rustfs

CVE-2026-40937CVE-2026-27822CVE-2026-27607CVE-2026-24762CVE-2026-21862

Stop the waste.
Protect your environment with Kodem.