Summary
A timing side-channel in PolarLearn's sign-in endpoint allows attackers to infer whether a specific email address is registered on the platform based on response time differences.
Because the server performs expensive Argon2 password hashing only for existing users, unauthenticated attackers can distinguish valid accounts from non-existent ones, enabling targeted user enumeration.
Affected context
This vulnerability occurs in the authentication logic of PolarLearn's sign-in endpoint where the backend:
- Looks up a user by email, and
- Runs Argon2 password hashing only when the user record exists.
The observable latency difference between requests for existing users (~650ms) and non-existent users (~160ms) can be measured over the network.
Any deployment that exposes this sign-in endpoint to the internet without additional rate limiting, noise, or constant-time behavior may be affected.
Exploit preconditions
- Attack surface: Public sign-in/login HTTP endpoint.
- Required access: No authentication required; only the ability to send repeated login requests and measure response times.
- Trigger point: Submitting login attempts with arbitrary email addresses to the sign-in endpoint.
- Why exploitation is possible: The application performs expensive Argon2 hashing only when a user exists, causing a consistent and measurable timing gap between existing and non-existing accounts. This data-dependent processing path creates a side-channel that leaks whether an email is registered.
Why this happens
The underlying issue is differential processing based on whether a user exists, which maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor via a timing side-channel.
In the vulnerable pattern, the authentication flow:
- Performs a cheap early exit for non-existent users, and
- Performs expensive Argon2 hashing only for existing users.
Because these code paths have significantly different and stable runtimes, an attacker can infer the existence of accounts without any direct information disclosure in the HTTP response.
This reflects a broader bug class where control flow and computation cost depend on sensitive state (e.g., account existence, secret validity) without being equalized, allowing remote timing analysis.
Potential impact
- Attackers may enumerate which email addresses are registered on the platform.
- Targeted attacks such as credential stuffing or password spraying can become more efficient by focusing only on known-valid accounts.
- Increased risk of spear-phishing and social engineering against confirmed platform users.
- Privacy exposure of user membership, which may be sensitive in certain contexts (e.g., educational or corporate environments).
General mitigation guidance
Effective mitigation focuses on removing data-dependent timing differences and reducing the value of user existence information:
- Normalize the authentication code path so that both existing and non-existing users incur similar computational cost (e.g., always run a dummy Argon2 hash on a constant value even when the user is not found).
- Use constant-time comparison functions for password verification and other secret checks to avoid additional micro-timing leaks.
- Avoid exposing explicit or implicit account existence signals in error messages, logs, or status codes; return uniform responses for failed sign-in attempts.
- Introduce application-level defenses such as rate limiting, IP throttling, and behavioral detection to make high-volume timing probes harder.
- Where possible, implement privacy-conscious workflows (e.g., email-based magic links or unified "check your email" flows) that do not reveal account existence during interactive login.
How teams detect issues like this
Detection typically combines code-level review with behavioral analysis:
- Static/code review: Look for authentication flows where:
- User lookup and password verification follow different code paths depending on existence.
- Expensive hashing or crypto operations are skipped for non-existent users.
- Error handling differs for "user not found" vs. "wrong password".
- Architectural review: Examine authentication modules for any logic that branches based on sensitive state and may change latency, execution count, or resource usage.
- Dynamic testing: Use automated probes or security testing tools to:
- Measure response time distributions for known-existing and guaranteed non-existing accounts.
- Identify statistically significant timing differences that correlate with account existence.
- Policy enforcement: Establish coding standards that require constant-time or cost-normalized authentication paths, and enforce them through code review checklists or automated linting where feasible.

