CVE-2026-54038: LibreChat: Server-Side ReDoS via Unescaped Regex in Principal Search
LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. Prior to 0.8.9, GET /api/permissions/search-principals passes the q parameter to JavaScript RegExp construction and MongoDB regex queries in packages/data-schemas/src/methods/userGroup.ts findGroupsByNamePattern and searchPrincipals without escaping metacharacters. An authenticated user with people-picker permission can submit a catastrophic-backtracking pattern that blocks the Node.js event loop and makes the service unresponsive to concurrent users; invalid patterns can also produce server errors. This issue is fixed in version 0.8.9.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.8.9
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker must be authenticated and have people-picker permission. They can target the GET /api/permissions/search-principals endpoint through its q parameter.
What is the practical impact of successful exploitation?
A user can submit a regex pattern that causes catastrophic backtracking, blocking the Node.js event loop and making the service unresponsive to concurrent users. Invalid regex patterns may also cause server errors.
Which deployments are affected and what is the fix?
LibreChat versions prior to 0.8.9 are affected. Upgrade to version 0.8.9, which fixes the unescaped regular-expression handling in principal and group searches.