[SECURITY] Timing Attack Vulnerability in Authentication #20

Open
opened 2026-02-14 21:24:51 +00:00 by thabeta · 0 comments
Owner

In src/server/auth.rs (Lines 64-68), the password comparison uses a standard string equality check:

if user_data.password != user.password { ... }

Risk: Standard string comparison (!=) returns as soon as a mismatch is found. This allows an attacker to perform a timing attack to guess the password character by character based on how long the server takes to respond.

Fix: Use a constant-time comparison (e.g., from the subtle crate) for all sensitive credential checks.

In `src/server/auth.rs` (Lines 64-68), the password comparison uses a standard string equality check: ```rust if user_data.password != user.password { ... } ``` **Risk:** Standard string comparison (`!=`) returns as soon as a mismatch is found. This allows an attacker to perform a timing attack to guess the password character by character based on how long the server takes to respond. **Fix:** Use a constant-time comparison (e.g., from the `subtle` crate) for all sensitive credential checks.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_fs#20
No description provided.