Severity:

HIGH RISK

(8.1)

SQL Injection in SOGo ACL Management addUserInAcls Endpoint

CVE-2026-8851

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authenticated Data Exfiltration via SQL Injection

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

SOGo 5.12.7 contains a SQL injection vulnerability in the Access Control List (ACL) management functionality, where the uid parameter of the addUserInAcls endpoint is not safely handled.

Authenticated users can inject SQL subqueries that cause arbitrary data from the database to be written into the sogo_acl table and later retrieved via the /acls API, enabling out-of-band data exfiltration.

Affected context

This vulnerability appears in SOGo 5.12.7 within the ACL management features, specifically when processing requests to the addUserInAcls endpoint.

It becomes relevant in deployments where authenticated users are allowed to manage or modify ACL entries and where the uid value provided by the client is passed into SQL queries without robust parameterization or sanitization.

The issue manifests when user-controlled identifiers are incorporated into database operations that influence what is stored in the sogo_acl table and subsequently exposed via the /acls API.

Exploit preconditions

  • Attack surface: HTTP(S) interface exposing SOGo's ACL management endpoints (e.g., /addUserInAcls and /acls).
  • Required access: Valid authenticated SOGo account with permission to invoke ACL-related operations.
  • Trigger point: Supplying a crafted uid parameter value to the addUserInAcls endpoint such that it alters the structure or behavior of the underlying SQL statement.
  • Why exploitation is possible: The backend constructs SQL queries using user-supplied data in a way that does not enforce strict separation between query structure and data, enabling injected SQL subqueries to manipulate inserts into sogo_acl and to be read back through the /acls endpoint.

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection).

In the vulnerable code path, the uid parameter from an ACL-related request is treated as a trusted value and incorporated into SQL statements without using safe parameter binding or thorough validation.

As a result, crafted input can break out of the expected data context and introduce additional SQL syntax, such as subqueries, that direct the database to copy arbitrary records into the sogo_acl table.

Because these records are later exposed through the /acls API, the injection becomes a practical channel for exfiltrating data that was never intended to be accessible through this interface.

Potential impact

  • Authenticated users may be able to read sensitive data from arbitrary database tables by funneling it into the sogo_acl table.
  • Attackers could infer or extract user account details, email metadata, or configuration records stored in the same database, depending on schema and privileges.
  • Existing access control boundaries enforced at the application level can be bypassed, allowing retrieval of data not normally available to the attacker's role.
  • SQL injection pathways can sometimes be extended to modify or corrupt ACL entries, potentially altering sharing permissions or access rights.
  • Database confidentiality may be degraded if the technique is automated or leveraged at scale.

General mitigation guidance

Effective mitigation focuses on enforcing strict separation between SQL code and user-controlled data, and on narrowing the scope of what ACL operations are allowed to do:

  • Use parameterized queries or prepared statements for all database operations involving the uid and other request parameters, ensuring user input cannot change query structure.
  • Apply rigorous validation to ACL-related identifiers, such as restricting uid to well-defined formats (e.g., canonical usernames or UUIDs) and rejecting any input that deviates from these constraints.
  • Introduce an explicit data access layer that limits what ACL management routines can query or write, avoiding generic "pass-through" SQL assembly in request handlers.
  • Apply the principle of least privilege to the database account used by SOGo, reducing its ability to read or write unrelated tables or sensitive columns.
  • Implement defense-in-depth controls like query whitelisting or ORM-level policies that disallow dynamic SQL fragments in ACL code paths.

These patterns reduce the likelihood that malformed input can influence SQL behavior and limit the blast radius if input handling fails.

How teams detect issues like this

Detecting this kind of SQL injection typically combines code-centric and behavior-centric approaches:

  • Static analysis: Configure code scanning tools to flag string concatenation or interpolation in SQL statements, especially in ACL-related modules and wherever uid or similar parameters are used.
  • Code review cues: During manual reviews, scrutinize any database access logic that handles ACL operations, focusing on whether all parameters are bound through prepared statements and whether input validation is centralized and consistent.
  • Runtime monitoring: Enable database query logging or use an application security monitoring solution to detect atypical queries, such as those containing nested subqueries or unexpected references to unrelated tables originating from ACL endpoints.
  • Security testing: Incorporate targeted tests into CI/CD (e.g., with DAST or specific SQL injection probes) against ACL APIs to verify that crafted input cannot alter query structure or leak data.
  • Policy enforcement: Adopt development guidelines that prohibit ad-hoc SQL construction in request handlers and require use of vetted data access utilities or ORM layers.

Sources

SourceLink
github.comgithub.com/Alinto/sogo/releases/tag/SOGo-5.12.8
sogo.nusogo.nu/news/2026/sogo-v5128-released.html
vulncheck.comvulncheck.com/advisories/sogo-sql-injection-via-adduserinacls-endpoint

Frequently asked

questions

Yes, if a SOGo instance is exposed over the network and an attacker can obtain valid credentials, the SQL injection can be triggered remotely through the ACL management API endpoints.

The attacker needs an authenticated SOGo account with the ability to interact with ACL-related operations. Elevated administrative privileges are not necessarily required if ordinary users can call the addUserInAcls endpoint.

The most robust fix is to remove any dynamic SQL construction based on raw request parameters and to adopt parameterized queries or ORM-based access exclusively, combined with strict whitelisting and validation of identifiers used within ACL operations.

Prevention relies on standardizing secure database access patterns (parameterized queries, vetted data access layers), enforcing input validation on all user-supplied fields, embedding security code review into change management for data-access code, and continuously running automated static and dynamic tests that look specifically for injection flaws.

Find out what's already
exploitable in your codebase.