Skip to content

Manipulation of Internal Dovecot Variables in mailcow via crafted Passwords

High
DerLinkman published GHSA-mhh4-qchc-pv22 Jun 7, 2023

Package

No package listed

Affected versions

<= 2023-05

Patched versions

>= 2023-05a

Description

Impact

A vulnerability has been discovered in mailcow. The vulnerability, allows an attacker to manipulate internal Dovecot variables by using specially crafted passwords during the authentication process.

The issue arises from the behavior of the passwd-verify.lua script, which is responsible during login. Upon a successful login, the script returns a response in the format of "password=", indicating the successful authentication.

By crafting a password with additional key-value pairs appended to it, an attacker can manipulate the returned string and influence the internal behavior of Dovecot. For example, using the password "123 mail_crypt_save_version=0" would cause the passwd-verify.lua script to return the string "password=123 mail_crypt_save_version=0". Consequently, Dovecot will interpret this string and set the internal variables accordingly, leading to unintended consequences.

By changing the password to a specific payload, the vulnerability can be exploited during the login process using the special-crafted password. Successful exploitation could result in unauthorized access to user accounts, bypassing security controls, or other malicious activities.

Patches

Versions including 2023-05a and later

Workarounds

There is NO workaround ! This exploit can be used by any user who can change their password (enabled by default and not changeable within mailcow).

References

https://github.com/VladimirBorisov/CVE_proposal/blob/main/MailcowUserPassword.md

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVE ID

CVE-2023-34108

Credits