Bug 1973609 (CVE-2021-29157)

Summary: CVE-2021-29157 dovecot: local attacker can login as any user and access their emails
Product: [Other] Security Response Reporter: Marian Rehak <mrehak>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: anon.amish, bennie.joubert, janfrode, mhlavink, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dovecot 2.3.14.1 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in dovecot where it did not properly parse the `kid` and `azp` fields in JWT tokens. This flaw allows a local attacker to bypass dovecot's authentication, and access a user's emails. The highest threat from this vulnerability is to confidentiality and integrity.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-15 13:18:46 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: 1974392, 1979833, 1980006, 1980007, 1980008    
Bug Blocks: 1973612    

Description Marian Rehak 2021-06-18 10:21:18 UTC
Dovecot does not correctly escape kid and azp fields in JWT tokens. This may be used to supply attacker controlled keys to validate tokens in some configurations. This requires attacker to be able to write files to local disk.

Workaround: Disable local JWT validation in oauth2, or use a different dict driver than fs:posix.

Reference: https://dovecot.org/pipermail/dovecot-news/2021-June/000461.html

Comment 1 Guilherme de Almeida Suckevicz 2021-06-21 14:48:55 UTC
Created dovecot tracking bugs for this issue:

Affects: fedora-all [bug 1974392]