Bug 2105070 (CVE-2022-30550)

Summary: CVE-2022-30550 dovecot: Privilege escalation when similar master and non-master passdbs are used
Product: [Other] Security Response Reporter: Sage McTaggart <amctagga>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: anon.amish, bennie.joubert, janfrode, jom, mhlavink, mspacek, pampelmuse
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A vulnerability was found in the Dovecot IMAP Server. When two passdb configuration entries exist in the Dovecot configuration, which have the same driver and args settings, the incorrect username_filter and mechanism settings can be applied to passdb definitions. These incorrect settings can lead to an unintended security configuration and can permit privilege escalation with certain configurations involving a master user authentication. If the same passwd file or PAM is used for both normal and master users, an attacker could easily become a master user, potentially escalating privileges on the system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-04 19:33:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2106227, 2106228, 2106229, 2106231, 2106232    
Bug Blocks: 2105072    

Description Sage McTaggart 2022-07-07 20:13:55 UTC
Affected product: Dovecot IMAP Server 
Internal reference: DOV-5320
Vulnerability type: Improper Access Control (CWE-284) 
Vulnerable version: 2.2
Vulnerable component: submission 
Report confidence: Confirmed 
Solution status: Fixed in main
Researcher credits: Julian Brook (julezman)
Vendor notification: 2022-05-06 
CVE reference: CVE-2022-30550
CVSS: 6.8 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N) 

Vulnerability Details: 
When two passdb configuration entries exist in Dovecot configuration, which have the same driver and args settings, the incorrect username_filter and mechanism settings can be applied to passdb definitions. These incorrectly applied settings can lead to an unintended security configuration and can permit privilege escalation with certain configurations involving master user authentication.

Dovecot documentation does not advise against the use of passdb definitions which have the same driver and args settings. One such configuration would be where an administrator wishes to use the same pam configuration or passwd file for both normal and master users but use the username_filter setting to restrict which of the users is able to be a master user.

Risk: 
If same passwd file or PAM is used for both normal and master users, it is possible for attacker to become master user.

Workaround:
Always authenticate master users from different source than regular users, e.g. using a separate passwd file. Alternatively, you can use global ACLs to ensure that only legimate master users have priviledged access.

Fix:
This has been fixed in main branch. See https://github.com/dovecot/core/compare/7bad6a24%5E..a1022072.patch

Comment 4 TEJ RATHI 2022-07-12 06:22:57 UTC
Created dovecot tracking bugs for this issue:

Affects: fedora-all [bug 2106228]


Created dovecot-fts-xapian tracking bugs for this issue:

Affects: epel-8 [bug 2106227]
Affects: fedora-all [bug 2106229]

Comment 8 errata-xmlrpc 2022-11-08 09:51:19 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:7623 https://access.redhat.com/errata/RHSA-2022:7623

Comment 9 errata-xmlrpc 2022-11-15 10:36:47 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2022:8208 https://access.redhat.com/errata/RHSA-2022:8208

Comment 10 Product Security DevOps Team 2022-12-04 19:33:22 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2022-30550