Skip to content
Naoya Tech
Go back

CVE-2026-27480: Timing-Based Username Enumeration in Static Web Server

Edit page

Summary

Static Web Server (SWS) is a cross-platform, high-performance web server for serving static files, written in Rust. I found that its HTTP Basic Authentication took a different code path depending on whether the username was valid. By measuring response times, an attacker could tell valid usernames from invalid ones. The issue was assigned CVE-2026-27480, rated Medium, and fixed in SWS v2.41.0.

At a Glance

ItemDetails
CVECVE-2026-27480
AdvisoryGHSA-qhp6-635j-x7r2
Projectstatic-web-server (Rust)
SeverityMedium — CVSS 3.1 score 5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)
WeaknessCWE-204: Observable Response Discrepancy
Affected2.1.0 to 2.40.1
Fixed2.41.0
Creditnaoyashiga (reporter), @joseluisq (remediation reviewer)

What Was Wrong

SWS checked the username before doing anything else:

Because the two cases ran different code, the response time depended on whether the username existed. In my tests (the mean of 100 requests each, measured with a small Rust program), the two cases differed by about 0.16 ms. In that environment valid usernames actually answered faster, but the gap was consistent, which showed that the check did not run in constant time.

Impact

Sites that protect content with SWS’s Basic Authentication were affected. Knowing which usernames are valid lets an attacker focus brute-force or credential-stuffing attacks on real accounts.

The Fix

The fix changes check_request in src/basic_auth.rs. It now always runs the bcrypt password check, whether or not the username matches, and only then combines the two results. Without the early return, both cases do the same work. If you use Basic Authentication, update to v2.41.0 or later.

Timeline (UTC)

References

概要(日本語)

Static Web Server(SWS)は、Rust で書かれたクロスプラットフォームで高速な静的ファイル配信用の Web サーバーです。SWS の HTTP Basic 認証では、ユーザー名が正しいかどうかで処理の流れが変わっていました。そのため、応答時間を測ることで、存在するユーザー名とそうでないユーザー名を見分けられる状態でした。この問題は CVE-2026-27480(深刻度 Medium)として登録され、SWS v2.41.0 で修正されました。

基本情報

項目内容
CVECVE-2026-27480
アドバイザリGHSA-qhp6-635j-x7r2
プロジェクトstatic-web-server(Rust)
深刻度Medium(CVSS 3.1 スコア 5.3、AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)
脆弱性の種類CWE-204: Observable Response Discrepancy(応答の違いから情報が漏れる)
影響バージョン2.1.0〜2.40.1
修正バージョン2.41.0
クレジットnaoyashiga(報告者)、@joseluisq(修正レビュー)

何が問題だったか

SWS は、まずユーザー名を確認していました。

  • ユーザー名が間違っている場合: すぐに 401 Unauthorized を返します。
  • ユーザー名が正しい場合: 続けて bcrypt でパスワードを検証します。

2つのケースで実行される処理が違うため、ユーザー名が存在するかどうかで応答時間が変わります。私の検証(自作の Rust プログラムで、それぞれ 100 回の平均を計測)では、約 0.16 ms の差がありました。この環境ではむしろ正しいユーザー名のほうが速く返りましたが、差は安定して出ており、認証処理が一定時間で動いていないことが確認できました。

影響

SWS の Basic 認証でコンテンツを保護しているサイトが影響を受けます。正しいユーザー名が分かると、攻撃者は実在するアカウントに絞って総当たり攻撃やリスト型攻撃(クレデンシャルスタッフィング)を仕掛けられます。

修正内容

修正では、src/basic_auth.rs の check_request が変更されました。ユーザー名が一致するかどうかに関係なく、常に bcrypt でパスワードを検証し、最後に2つの結果を組み合わせて判定します。途中で処理を打ち切らなくなったため、どちらのケースでも同じ処理が実行されます。Basic 認証を使っている場合は、v2.41.0 以降に更新してください。

タイムライン(UTC)

  • 2026-02-17 — SWS のリポジトリでセキュリティアドバイザリを作成
  • 2026-02-19 — 修正がマージされる
  • 2026-02-20 — v2.41.0 のリリースとアドバイザリの公開
  • 2026-02-20 — GitHub Advisory Database に CVE-2026-27480 として登録

参考リンク


Edit page
Share this post on:

Previous Post
CVE-2026-27822: Critical Stored XSS in the RustFS Console Leading to Admin Account Takeover
Next Post
Migrating to Astro and My Goals for 2026