Sync-in Server has Username/Login Enumeration via Timing Side-Channel on POST /api/auth/login (incomplete fix of the prior timing-attack advisory)GHSA-29hq-23m2-2j47
MEDIUMFix: Sync-in/server@b80efe0GHSA-29hq-23m2-2j47 is a medium-severity (CVSS 5.3) CWE-208 vulnerability in @sync-in/server. A fix is available for @sync-in/server — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-29hq-23m2-2j47.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-29hq-23m2-2j47 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@sync-in/servernpmDescription
Summary
validateUser() in backend/src/authentication/providers/mysql/auth-provider-mysql.service.ts returns immediately when the supplied login/email does not match any account, without ever calling comparePassword():
async validateUser(loginOrEmail: string, password: string, ip?: string, scope?: AUTH_SCOPE): Promise<UserModel> {
let user: UserModel
try {
user = await this.usersManager.findUser(loginOrEmail, false)
} catch (e) { ... }
if (!user) {
this.logger.warn(...)
return null // <-- comparePassword() is never reached here
}
return await this.usersManager.logUser(user, password, ip, scope)
}
comparePassword() (backend/src/common/functions.ts) already contains a dummy-hash branch that was clearly added to defend against exactly this class of attack:
export async function comparePassword(password: string, hash?: string | null): Promise<boolean> {
if (!hash) {
// No hash, waste time for time-based attacks
await bcrypt.compare(password, DUMMY_PASSWORD_HASH)
return false
}
return await bcrypt.compare(password, hash)
}
The problem is that this protection only runs when comparePassword() is actually invoked with a falsy hash. Because validateUser() short-circuits with return null as soon as findUser() comes back empty, the "account doesn't exist" path skips all cryptographic work entirely, while the "account exists, wrong password" path always performs a real bcrypt comparison (cost factor 10, ~100ms+). The two outcomes are trivially distinguishable by response time.
There's already a published advisory in this repo for "Username Enumeration via Timing Attack" - this looks like the same underlying issue surfacing through a different call path (the early return in validateUser()) that the existing fix (the dummy-hash branch in comparePassword()) doesn't actually reach, rather than a brand new vulnerability class.
Impact
Any unauthenticated client can determine whether a given username/email is a valid account on the instance by timing POST /api/auth/login:
- Non-existent login: near-instant rejection (no bcrypt call).
- Existing login (regardless of password correctness): consistently slower due to a real bcrypt comparison.
This enables efficient enumeration of valid accounts, which can then be used to focus credential-stuffing, password-spraying, or phishing against confirmed-valid targets.
Proof of Concept
Verified with the actual comparePassword() logic and the real DUMMY_PASSWORD_HASH constant copied verbatim from backend/src/common/functions.ts, using the project's own bcryptjs dependency (no mocking of bcrypt itself):
Avg time for "login does not exist" path (validateUser returns null, no bcrypt call): 0.00 ms
Avg time for "login exists, wrong password" path (real bcrypt.compare runs): 114.90 ms
Difference: 114.90 ms (ratio: ~58923x)
The "not found" path reproduces validateUser()'s exact early return (no call into comparePassword); the "wrong password" path reproduces logUser()'s real call into comparePassword(password, user.password). The gap is large enough to be trivially observable over a real network, even accounting for jitter.
Reachable endpoint: POST /api/auth/login, guarded only by AuthLocalGuard (Passport local strategy invoking validateUser()), no authentication required.
Suggested fix
Make validateUser() always pass through comparePassword()'s timing-equalized path, even when no user is found, e.g.:
if (!user) {
await comparePassword(password, null) // burns the same time as a real comparison
return null
}
so the "account not found" and "account found, wrong password" branches take statistically indistinguishable time.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @sync-in/server | all versions | 2.4.1npm install @sync-in/server@2.4.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @sync-in/server, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @sync-in/server to 2.4.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-29hq-23m2-2j47 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-29hq-23m2-2j47 in your dependencies?
Find it across npm, including transitive dependencies.