/

CVE-2026-46446

Severity:

HIGH RISK

(7.1)

SQL Injection in SOGo changePasswordForLogin with Cleartext

CVE-2026-46446

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authentication Data Compromise and Potential Account Takeover

Severity:

HIGH RISK

(7.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 versions before 5.12.7 contain a SQL injection vulnerability in the changePasswordForLogin functionality when backed by PostgreSQL or MariaDB and configured to store cleartext passwords.

Under these conditions, untrusted password data can be concatenated into SQL queries, allowing an attacker to manipulate the query logic and potentially alter or access authentication data.

Affected context

The vulnerability occurs in SOGo deployments that:

  • Use PostgreSQL or MariaDB as the backend
  • Store user passwords in cleartext in the database
  • Rely on the changePasswordForLogin routine to update user credentials

In this context, user-supplied values are interpolated into SQL statements, and the use of patterns like c_password = '%@' creates an opportunity for crafted input to break query boundaries.

Exploit preconditions

  • Attack surface: Application-level password change interface or any code path that invokes changePasswordForLogin.
  • Required access: Ability to submit or influence password values that flow into the vulnerable SQL assignment (e.g., self-service password change, administrative password reset, or API calls).
  • Trigger point: Execution of the changePasswordForLogin routine that builds a SQL statement with c_password = '%@' and concatenates untrusted input without safe parameter binding.
  • Why exploitation is possible: The password value is embedded directly into the SQL string instead of being passed as a typed, bound parameter; this allows malicious characters to alter the structure of the query rather than being treated purely as data.

Why this happens

The underlying issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

In the affected code, the password field is interpolated into an SQL expression as a string literal (c_password = '%@') using string formatting or concatenation.

Because the input is not strongly parameterized and is only protected (if at all) by ad-hoc quoting, attackers can inject SQL control characters, terminate the intended string, and append arbitrary clauses.

This pattern breaks the intended separation between data and code, exposing the database to unintended commands whenever untrusted input reaches the vulnerable query construction logic.

Potential impact

  • Bypassing or manipulating authentication data by altering stored passwords.
  • Unauthorized modification of user account records, potentially leading to account takeover.
  • Exposure of sensitive credential information if error messages or query behavior reveal underlying data.
  • Escalation of impact to broader data tampering or retrieval within the same database schema, depending on the constructed query and DB privileges.
  • Degradation of service availability if injected queries cause locking, errors, or resource exhaustion.

General mitigation guidance

Effective mitigation typically focuses on enforcing strict separation between SQL code and user data, and reducing the sensitivity of stored secrets:

  • Use parameterized queries or prepared statements for all database interactions, ensuring password values are always transmitted as bound parameters rather than concatenated into SQL strings.
  • Centralize database access behind a well-reviewed data access layer that prohibits inline string-built queries for authentication-related operations.
  • Avoid storing passwords in cleartext; use slow, salted password hashing functions to reduce the impact of any data access or injection issue.
  • Apply least-privilege principles to the database account used by SOGo so that, even if a query is manipulated, it cannot access or modify unrelated schemas or administrative tables.
  • Introduce input validation and normalization for password fields to reject clearly malformed or control-heavy inputs, while recognizing that validation is a secondary layer behind parameterization.

How teams detect issues like this

Detection is best approached through a combination of static and operational controls:

  • Use static analysis configurations or custom rules to flag string-built SQL queries that interpolate variables, especially in authentication and password-related code paths.
  • During code review, pay attention to any use of format strings or concatenation in queries (e.g., patterns like ... = '%@'), and require parameter binding for all user-influenced values.
  • Apply database-side monitoring or logging to detect anomalous query patterns, such as unexpected comment markers, multiple statements in a single query, or frequent syntax errors near password fields.
  • Integrate automated security testing (such as SAST tools and targeted SQL injection tests for password-change flows) into CI pipelines to catch regressions in query construction patterns.

Sources

SourceLink
github.comgithub.com/Alinto/sogo/pull/379/changes/1f7e5d2b2c2047c44a6a9e05f73c36491cb96d21
mail-archive.commail-archive.com/debian-bugs-dist%40lists.debian.org/msg2100131.html
sogo.nusogo.nu/news/2026/sogo-v5127-released.html

Frequently asked

questions

Yes, if an attacker can interact with any remote interface that ultimately invokes changePasswordForLogin with user-controlled password values. The exploitability depends on how exposed and constrained the password change or reset functionality is.

An attacker must be able to provide or influence password input that flows into the vulnerable SQL query. This might be through a regular user account changing its own password, a compromised account accessing password reset endpoints, or any API client with permission to update credentials.

Refactor the affected code to use parameterized queries or prepared statements for all operations that set or compare passwords, eliminating any string concatenation or format-based query building. At the same time, transition away from cleartext password storage to robust, salted password hashing.

Establish a development standard that prohibits concatenated SQL in favor of parameterized data access, enforce these standards via code review and static analysis, and encapsulate database operations in shared libraries. Combine this with secure credential storage practices and regular security testing focused on authentication paths.

Find out what's already
exploitable in your codebase.