Summary
An authenticated SQL injection flaw in the Group-Office JMAP Contact/query endpoint allows users with basic address book access to manipulate database queries and read arbitrary data.
Under these conditions, an attacker can extract sensitive information such as active session tokens for other users, enabling full account takeover without needing their passwords.
Affected context
This vulnerability occurs in Group-Office deployments where:
- The JMAP API is enabled and the
Contact/queryendpoint is exposed. - Users have basic access to the address book/contact functionality.
- Backend SQL queries within the JMAP contact query handling logic are constructed using user-influenced data without adequate parameterization.
The issue is limited to authenticated contexts, but applies broadly to any authenticated user with minimal address book permissions.
Exploit preconditions
- Attack surface: HTTP(S) interface exposing the JMAP
Contact/queryendpoint. - Required access: Valid, low-privileged Group-Office account with basic address book/contact access.
- Trigger point: Submission of crafted query parameters or filters to the
Contact/queryendpoint that are incorporated into SQL statements. - Why exploitation is possible: User-controlled input is embedded into SQL queries without strict parameter binding or sufficient server-side validation, allowing the attacker to alter the structure of the query and access arbitrary database records.
Why this happens
The root cause maps directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
In the affected JMAP Contact/query implementation, input parameters controlling how contacts are searched or filtered are incorporated into SQL statements in a way that does not consistently use prepared statements or safe parameter binding. This pattern allows maliciously crafted values to modify the intended query logic instead of being treated as data. The design effectively trusts user input as part of the SQL command, enabling attackers to pivot from legitimate lookups to arbitrary data extraction within the same database context.
Potential impact
- Extraction of arbitrary database records that the application's database account can access.
- Disclosure of active session tokens belonging to other users.
- Full account takeover of arbitrary users, including System Administrator accounts, by reusing stolen session tokens.
- Exposure of sensitive customer, CRM, and groupware data stored in Group-Office.
- Potential pivoting to further compromise of integrated systems if credentials or secrets are stored in the database.
General mitigation guidance
Effective mitigation focuses on eliminating injection points and reducing trust in user-controlled query parameters:
- Use parameterized queries or prepared statements for all database access paths in the JMAP
Contact/queryimplementation and any similar endpoints. - Avoid dynamically building SQL fragments (e.g., WHERE clauses, ORDER BY, or filter expressions) directly from user input; instead, map user options to a fixed, whitelist-based query model.
- Normalize and strictly validate request parameters (field names, operators, sort keys) against a predefined schema for allowable values and patterns.
- Enforce least-privilege for the database account used by the Group-Office application to limit what data can be accessed, even if a query is compromised.
- Introduce centralized query builder utilities or ORM patterns that enforce safe-by-default query construction and prevent raw SQL concatenation.
How teams detect issues like this
Organizations can identify and monitor for this class of issue using:
- Static analysis: Rules that flag raw SQL string concatenation, dynamic WHERE clause construction, and use of unparameterized input in DB queries within JMAP and contact-related modules.
- Code review: Explicit review checklists that require verification of parameter binding and whitelist-based validation for any user-controllable query/filter/sort functionality.
- Dynamic testing: Targeted security tests or automated DAST tools configured to exercise the
Contact/queryendpoint with injection payloads and monitor for anomalies or data leakage. - Logging and monitoring: Application and database logs configured to flag unusual query patterns (e.g., unexpected UNIONs, subqueries, or access to tables unrelated to contacts) and high-volume data extraction from sensitive tables.

