Vendure vulnerable to timing attack that enables user enumeration in NativeAuthenticationStrategy

Description

Summary

The NativeAuthenticationStrategy.authenticate() method is vulnerable to a timing attack that allows attackers to enumerate valid usernames (email addresses).

Details

In packages/core/src/config/auth/native-authentication-strategy.ts, the authenticate method returns immediately if a user is not found:

const user = await this.userService.getUserByEmailAddress(ctx, data.username);
if (!user) {
    return false; // Instant return (~1-5ms)
}
const passwordMatch = await this.verifyUserPassword(ctx, user.id, data.password);
// Password check takes ~200-400ms with bcrypt (12 rounds)

The significant timing difference (~200-400ms for bcrypt vs ~1-5ms for DB miss) allows attackers to reliably distinguish between existing and non-existing accounts.

Impact

  • Attackers can enumerate valid user accounts
  • Enables targeted brute-force or phishing attacks
  • Information disclosure (account existence)

Recommended Fix

Perform a dummy bcrypt check when user is not found to ensure consistent response times.

Basic information

Type
reviewed
Severity
low
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-01-30 19:35:40 UTC
Updated
2026-01-30 19:35:42 UTC
GitHub reviewed
2026-01-30 19:35:40 UTC
NVD published
2026-01-30

EPSS Score

Score Percentile
0.02% 5.41%

CVSS Scores

Base score Version Severity Vector
2.7 4.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:U Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:N)
No additional preconditions are required beyond normal reachability.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:L)
Limited confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:N)
No availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.
Exploit maturity (threat) (E:U)
Unreported: no public PoC, no reported exploitation, and no known simplification tools.

Identifiers

CWEs

CWE id Name
CWE-202 Exposure of Sensitive Information Through Data Queries

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
npm @vendure/core < 3.5.3 3.5.3

References

cvelogic Threat Intelligence