Skip to content
Naoya Tech
Go back

CVE-2026-27822: Critical Stored XSS in the RustFS Console Leading to Admin Account Takeover

Edit page

Summary

RustFS is an open-source, S3-compatible, high-performance object storage system written in Rust. I found a stored cross-site scripting (XSS) vulnerability in the RustFS Console, its web management UI. A file with a .pdf name but a text/html content type ran as a web page when an administrator previewed it. Its script could then read the administrator’s S3 credentials from the browser. The issue was assigned CVE-2026-27822, rated Critical (CVSS 9.0), and fixed in RustFS 1.0.0-alpha.83.

At a Glance

ItemDetails
CVECVE-2026-27822
AdvisoryGHSA-v9fg-3cr2-277j
Projectrustfs (Rust)
SeverityCritical — CVSS 3.1 score 9.0 (AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H)
WeaknessCWE-79: Cross-site Scripting
AffectedVersions before 1.0.0-alpha.83
Fixed1.0.0-alpha.83
Creditnaoyashiga (reporter)

What Was Wrong

Three things combined to make this possible:

  1. Credentials in localStorage: the Console kept highly sensitive S3 credentials (access key, secret key and session token) in the browser’s localStorage.
  2. Trusting the file name: the preview modal decided whether a file was a PDF from its extension or metadata, and showed it in an <iframe>. It did not check the content type the server actually returned.
  3. One origin for everything: RustFS usually serves the Console and the S3 API from the same origin (the same host and port). A file shown in the <iframe> therefore shared the Console’s origin.

An attacker who could upload objects could store an HTML file named xss.pdf with its Content-Type set to text/html. When an administrator clicked Preview on that file, the browser rendered it as HTML inside the same-origin <iframe>. Its script could then read the parent window’s localStorage, including the credentials.

Impact

The attacker obtained the administrator’s AccessKeyId, SecretAccessKey and SessionToken, which meant a full account takeover. With them, any administrative action is possible through the S3 API: deleting data, creating backdoors or downloading everything stored. The attack needs an account that can upload files and an administrator who opens the preview, but the stakes are high, which is why it was rated Critical.

The Fix

RustFS fixed the issue in 1.0.0-alpha.83, so update to that version or later. In the report I also proposed these defenses against this class of bug:

Timeline (UTC)

I also talk about this report on my YouTube channel (in Japanese).

Earning a CVE: Reporting a Critical Vulnerability in RustFS, an S3-Compatible Object Storage YouTube · 11:50 · in Japanese

References

概要(日本語)

RustFS は、Rust で書かれたオープンソースの S3 互換・高性能オブジェクトストレージです。RustFS の Web 管理画面「RustFS Console」に、蓄積型(Stored)のクロスサイトスクリプティング(XSS)脆弱性がありました。名前は .pdf でもコンテンツタイプが text/html のファイルを管理者がプレビューすると、Web ページとして実行されてしまいます。そのスクリプトから、ブラウザに保存された管理者の S3 認証情報を読み取れる状態でした。この問題は CVE-2026-27822(深刻度 Critical、CVSS 9.0)として登録され、RustFS 1.0.0-alpha.83 で修正されました。

基本情報

項目内容
CVECVE-2026-27822
アドバイザリGHSA-v9fg-3cr2-277j
プロジェクトrustfs(Rust)
深刻度Critical(CVSS 3.1 スコア 9.0、AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H)
脆弱性の種類CWE-79: クロスサイトスクリプティング
影響バージョン1.0.0-alpha.83 より前のバージョン
修正バージョン1.0.0-alpha.83
クレジットnaoyashiga(報告者)

何が問題だったか

次の3つが重なって起きていました。

  1. 認証情報が localStorage にある: Console は、アクセスキー・シークレットキー・セッショントークンという重要な S3 認証情報を、ブラウザの localStorage に保存していました。
  2. ファイル名を信用している: プレビュー画面は、拡張子やメタデータからファイルが PDF かどうかを判断し、<iframe> で表示していました。サーバーが実際に返すコンテンツタイプは確認していませんでした。
  3. すべてが同じオリジン: RustFS は通常、Console と S3 API を同じオリジン(同じホストとポート)で提供します。そのため、<iframe> に表示されたファイルも Console と同じオリジンになります。

オブジェクトをアップロードできる攻撃者は、xss.pdf という名前の HTML ファイルを、Content-Type を text/html にして保存できます。管理者がそのファイルの Preview をクリックすると、ブラウザは同じオリジンの <iframe> の中でそれを HTML として表示します。そのスクリプトは親ウィンドウの localStorage を読めるので、認証情報も取得できます。

影響

攻撃者は管理者の AccessKeyId、SecretAccessKey、SessionToken を入手でき、アカウントを完全に乗っ取れます。これらがあれば、S3 API を通じてデータの削除、バックドアの作成、保存されているデータ全体のダウンロードなど、あらゆる管理操作ができます。攻撃にはファイルをアップロードできるアカウントと、管理者がプレビューを開くことが必要ですが、被害が大きいため Critical と評価されました。

修正内容

RustFS は 1.0.0-alpha.83 でこの問題を修正しました。このバージョン以降に更新してください。報告では、この種の問題への対策として次の2つも提案しました。

  • オリジンの分離: ユーザーがアップロードしたコンテンツを Console とは別の専用ドメインから配信し、ブラウザの同一オリジンポリシーで隔離する。
  • セキュリティヘッダー: インラインスクリプトを禁止する厳格な Content-Security-Policy と、宣言と異なる種類のコンテンツとしてブラウザに解釈させない X-Content-Type-Options: nosniff を設定する。

タイムライン(UTC)

  • 2026-02-01 — RustFS のリポジトリでセキュリティアドバイザリを作成
  • 2026-02-11 — RustFS 1.0.0-alpha.83 リリース
  • 2026-02-24 — RustFS がアドバイザリを公開
  • 2026-02-25 — GitHub Advisory Database に CVE-2026-27822 として登録

関連動画

この報告については YouTube チャンネルでも解説しています。

【CVE取得】OSSのCriticalな脆弱性を報告しました。S3代替オブジェクトストレージ「RustFS」。 YouTube · 11:50

参考リンク


Edit page
Share this post on:

Previous Post
CVE-2026-46547: Reflected XSS via the Redirect URL on NocoDB's Page Leaving Warning
Next Post
CVE-2026-27480: Timing-Based Username Enumeration in Static Web Server