Insufficient Entropy in LibreChat - #VU166556
Published: November 18, 2026
Vulnerability details
The vulnerability allows a local user to recover backup codes from exposed database records and potentially bypass two-factor authentication.
The vulnerability exists due to insufficient entropy in LibreChat's api/server/services/twoFactorService.js when generating 80-bit TOTP secrets and 32-bit backup codes, with backup codes stored as unsalted SHA-256 hashes. A local user can enumerate the backup-code space offline after obtaining stored hashes to recover unused second-factor credentials and, with a valid account password, bypass two-factor authentication.