Executive brief
Countly Server's DBViewer component allows unauthorized users to read sensitive data by bypassing access controls in the database query aggregation endpoint. An attacker with read permissions can exploit flawed validation logic to access restricted collections and steal sensitive information such as password-reset tokens, potentially enabling account takeover.
Technical details
The vulnerability exists in the /o/db aggregation endpoint, which parses user-controlled JSON and validates it through a stage sanitizer. The sanitizer incorrectly identifies sub-pipelines by checking if all elements contain keys from a hardcoded KNOWN_STAGE_OPERATORS set. An attacker can inject an undocumented MongoDB-internal operator such as $_internalInhibitOptimization to trick the sanitizer into misclassifying the branch as a generic array, bypassing stage-level stripping. This allows injection of forbidden operators like $lookup inside $facet sub-pipelines to perform cross-collection joins and access restricted data. The vulnerability requires DBViewer read permission but does not require admin privileges. A fix was merged via an allow-list validation approach in August 2026.
Affected products
- Countly Server <7868
Timeline
- 2026-09-10: disclosed: CVE-2026-87803 published
- 2026-08-25: patched: Fix merged in PR #7868 with allow-list validation approach