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
| Item | Details |
|---|---|
| CVE | CVE-2026-27480 |
| Advisory | GHSA-qhp6-635j-x7r2 |
| Project | static-web-server (Rust) |
| Severity | Medium — CVSS 3.1 score 5.3 (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N) |
| Weakness | CWE-204: Observable Response Discrepancy |
| Affected | 2.1.0 to 2.40.1 |
| Fixed | 2.41.0 |
| Credit | naoyashiga (reporter), @joseluisq (remediation reviewer) |
What Was Wrong
SWS checked the username before doing anything else:
- Invalid username: the server returned
401 Unauthorizedimmediately. - Valid username: the server went on to verify the password with bcrypt.
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)
- 2026-02-17 — Security advisory opened in the SWS repository
- 2026-02-19 — Fix merged
- 2026-02-20 — v2.41.0 released and the advisory published
- 2026-02-20 — Added to the GitHub Advisory Database as CVE-2026-27480
References
概要(日本語)
Static Web Server(SWS)は、Rust で書かれたクロスプラットフォームで高速な静的ファイル配信用の Web サーバーです。SWS の HTTP Basic 認証では、ユーザー名が正しいかどうかで処理の流れが変わっていました。そのため、応答時間を測ることで、存在するユーザー名とそうでないユーザー名を見分けられる状態でした。この問題は CVE-2026-27480(深刻度 Medium)として登録され、SWS v2.41.0 で修正されました。
基本情報
| 項目 | 内容 |
|---|---|
| CVE | CVE-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 として登録