/

CVE-2026-27822

Severity:

CRITICAL RISK

(9.0)

Cross-Site Scripting (XSS) in RustFS Management Console

CVE-2026-27822

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover and Management Console Compromise

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A stored cross-site scripting (XSS) vulnerability in the RustFS Console allows untrusted content to be rendered as active JavaScript within the management interface.

If an attacker can upload or manipulate PDF-related content to bypass the preview logic, they can execute arbitrary scripts in an administrator's browser and steal credentials from localStorage, potentially leading to full account takeover and compromise of the storage system.

Affected context

This issue affects RustFS deployments that expose the RustFS Console for administrative or operational management.

The vulnerability resides in how PDF preview or related content is handled and rendered in the web UI, where certain user-controlled data can bypass sanitization or content restrictions and be interpreted as executable script by the browser.

The risk is highest in environments where users can upload files or content that later appears in the console viewed by privileged administrators.

Exploit preconditions

  • Attack surface: RustFS Console web interface, particularly the PDF preview or associated rendering flow.
  • Required access: Ability to upload or otherwise control content that is later displayed in the console (e.g., user account, compromised user, or exposed upload endpoint).
  • Victim role: A privileged console user (such as an administrator) must view or interact with the malicious content through the console UI.
  • Trigger point: Browser renders the stored malicious payload when loading the PDF preview or related resource.
  • Why exploitation is possible: The console's rendering logic fails to consistently sanitize or neutralize attacker-controlled content, allowing it to be interpreted by the browser as JavaScript within the console's origin.

Why this happens

The vulnerability stems from improper neutralization of user-controlled content before it is rendered in the RustFS Console, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The PDF preview logic or the surrounding UI flow treats certain stored data as safe and injects it into the DOM or a browser context without robust escaping, sanitization, or isolation mechanisms such as Content Security Policy (CSP).

As a result, an attacker-controlled payload can persist inside application state or stored objects and later execute as script in the context of the console when an administrator views the content.

Potential impact

  • Theft of administrator credentials or tokens stored in localStorage.
  • Full account takeover of affected administrative users.
  • Execution of arbitrary JavaScript in the context of the RustFS Console origin.
  • Modification of system configuration, access policies, or storage settings via the compromised admin session.
  • Lateral movement to other systems or data sets managed through the console.
  • Persistence of malicious actions such as creation of backdoor accounts or alteration of audit logging configuration.

General mitigation guidance

Effective mitigation focuses on systematically treating all user-controlled content as untrusted and ensuring it cannot execute as active script within the console:

  • Apply strict output encoding/escaping for any dynamic values injected into HTML, attributes, URLs, and JavaScript contexts.
  • Use a robust HTML sanitization library for any rich content or previewed data, limiting allowed tags and attributes to a safe subset.
  • Decouple preview logic from the main console origin where feasible (e.g., serve previews from a separate, locked-down domain or sandboxed iframe with restrictive sandbox attributes).
  • Enforce a strong Content Security Policy (CSP) that disallows inline scripts and restricts script sources to trusted endpoints.
  • Minimize sensitive data stored in localStorage; prefer more ephemeral or HttpOnly cookie-based mechanisms when appropriate to reduce exposure to XSS.
  • Follow secure-by-default UI patterns where file previews are treated as potentially hostile and rendered in non-executable contexts.

How teams detect issues like this

Detection can combine code-level and behavior-level approaches:

  • Static analysis: Configure linters and SAST tools to flag direct insertion of unescaped variables into templates, innerHTML, or other DOM sinks, especially in preview or file-handling code paths.
  • Code review: Systematically review UI components that render user-provided content, checking for consistent use of encoding/sanitization utilities and the absence of inline event handlers or string-based DOM manipulation.
  • Security testing: Incorporate automated and manual XSS testing into QA and CI pipelines, focusing on file upload, preview, and rich-content features.
  • Runtime monitoring: Use web application firewalls (WAFs) or reverse proxies with XSS detection rules to log and optionally block traffic that contains suspicious script injection patterns.
  • Policy enforcement: Maintain a security checklist for UI features that handle untrusted input, ensuring CSP, sandboxing, and sanitization are in place before deployment.

Sources

SourceLink
github.comgithub.com/rustfs/rustfs/security/advisories/GHSA-v9fg-3cr2-277j

Frequently asked

questions

Yes. If an attacker can remotely upload or control content that is later viewed in the RustFS Console, they can exploit the stored XSS without direct access to the console host itself. The attack completes when an administrator's browser renders the malicious content.

No. The attacker typically only needs a way to introduce malicious content into the system (for example, via a lower-privileged account or exposed upload mechanism). Administrative access is required only on the victim side—an admin must view the malicious preview for the exploit to run and for their session to be compromised.

The safest pattern is to treat all previewed or user-controlled content as untrusted, apply strict contextual output encoding, and sanitize any HTML-like content before rendering. Complement this with a strong CSP and, where possible, render previews in sandboxed contexts isolated from the main console origin.

Embed defensive patterns into the development lifecycle: use secure templating engines that auto-escape by default, centralize and reuse sanitization/encoding utilities, enforce CSP and sandboxing for rich content features, and include XSS-specific checks in code review, automated tests, and security tooling.

Find out what's already
exploitable in your codebase.