/

CVE-2026-62378

Severity:

CRITICAL RISK

(9.0)

Stored XSS (CWE-79) in RustFS Console PDF Preview

CVE-2026-62378

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting leading to credential and session token exposure

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

RustFS Console contains a stored cross-site scripting flaw in its extension-based PDF preview feature, where files with a .pdf extension can render attacker-controlled HTML instead of being treated as documents.

If an attacker can upload such crafted PDFs, they may execute arbitrary scripts in the administrator's browser session and potentially extract sensitive AccessKeyId, SecretAccessKey, and SessionToken values from the management console.

Affected context

The vulnerability arises in RustFS Console's web UI, specifically in the components/object/preview-modal.tsx and components/object/pdf-viewer.tsx components that handle PDF previews based on file extension.

In deployments where users or automated processes can upload files with a .pdf extension, and where the preview feature renders content without enforcing strict PDF handling or output encoding, HTML content can be interpreted as active web content in the administrator's browser.

This issue is particularly relevant in multi-tenant or semi-trusted environments where less-privileged users can create or manage objects that are later inspected by administrators through the preview modal.

Exploit preconditions

  • Attack surface: RustFS Console web interface, specifically the PDF preview functionality.
  • Required access: Ability to upload or otherwise cause storage of files with a .pdf extension in a location browsed via the management console.
  • Trigger point: An administrator or privileged user opens the object preview for the crafted .pdf in the console, causing the embedded content to be rendered in the browser.
  • Why exploitation is possible: The preview logic relies on file extension and renders the content as HTML-capable data without proper sanitization, output encoding, or strict PDF parsing, allowing attacker-controlled script to execute in the privileged user's browser context.

Why this happens

The core issue is an output encoding and content handling flaw aligned with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The PDF preview path treats the contents of .pdf-named objects as renderable HTML or browser-interpreted content, rather than enforcing a non-executable document format or neutralizing active elements.

Because user-supplied content is reflected into the DOM without robust sanitization or context-aware encoding, attacker-controlled script can execute persistently whenever the preview is viewed, effectively turning uploaded objects into stored XSS payloads.

Potential impact

  • Theft of administrator AccessKeyId, SecretAccessKey, and SessionToken values displayed or accessible in the console.
  • Execution of arbitrary JavaScript in the context of the RustFS Console origin.
  • Unauthorized actions performed on behalf of an administrator, including configuration changes or object manipulation.
  • Lateral movement into other services or infrastructure that trust the compromised credentials.
  • Persistent compromise of the management interface until the malicious object is removed or the flaw is mitigated.

General mitigation guidance

Resilience against this class of vulnerability generally involves making the rendering path safe-by-default and reducing trust in stored content:

  • Treat files based on validated content type and parsing, not solely on extension, and enforce strict PDF handling for previews.
  • Apply robust, context-aware output encoding and, where necessary, use well-maintained HTML sanitization libraries before injecting any user-controlled data into the DOM.
  • Prefer iframe-based or viewer-based document rendering that isolates untrusted content and avoids direct HTML injection into privileged UI contexts.
  • Limit where and how sensitive credentials are displayed in the UI, and avoid exposing raw long-lived secrets in routine views.
  • Apply least-privilege principles to access tokens and keys used within the console so that stolen values have constrained scope and lifetime.

How teams detect issues like this

Detection usually combines preventative checks and runtime monitoring:

  • Use static analysis and linting rules to flag direct insertion of untrusted data into JSX/HTML without proper encoding or sanitization, particularly in preview or viewer components.
  • During code review, pay close attention to file preview and rendering logic that depends on extensions or dynamic content types, and verify that no active content can be executed from stored objects.
  • Implement content security policies (CSP) that restrict inline scripts and unauthorized resource loading, helping to limit the blast radius of XSS bugs.
  • Leverage automated security testing (e.g., SAST and DAST tools) to probe upload/preview flows for stored XSS behavior as part of CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/rustfs/console/commit/49630dc140e6818aaee8879ade038a129838a2f2
github.comgithub.com/rustfs/console/releases/tag/v0.1.10
github.comgithub.com/rustfs/rustfs/security/advisories/GHSA-7gcx-wg4x-q9x6

Frequently asked

questions

The vulnerability primarily affects environments where untrusted or semi-trusted users can cause files with a .pdf extension to be stored and later previewed by administrators.

In such setups, a single malicious upload can yield a persistent XSS that triggers whenever a privileged user opens the preview.

The attacker needs the ability to upload or manage objects that the RustFS Console can preview as PDFs.

They do not need direct access to the administrator account; exploitation relies on the administrator viewing the crafted object through the console.

Enforce strict, non-executable rendering for document previews and ensure all user-supplied content is sanitized and contextually encoded before it reaches the DOM.

Align rendering logic with MIME types and trusted parsers rather than file extensions, and avoid exposing sensitive secrets where they are easily accessible to client-side scripts.

Adopt a secure-by-default UI framework stance where any data coming from stored or user-controlled sources is treated as untrusted.

Combine content security policies, static analysis rules, and rigorous code reviews focused on preview/upload features, and include automated XSS-focused tests in CI to catch regressions early—especially for areas that have had prior related CVEs.

Find out what's already
exploitable in your codebase.