CVE-2021-29157
Dovecot vulnerability analysis and mitigation

Overview

CVE-2021-29157 is a path traversal vulnerability discovered in Dovecot versions before 2.3.15, disclosed on June 28, 2021. The vulnerability affects the OAuth2 authentication mechanism when using local JWT validation with the posix fs driver. This security issue allows an attacker with local filesystem access to trick OAuth2 authentication into using an HS256 validation key from an attacker-controlled location (NVD, Dovecot Security).

Technical details

The vulnerability stems from improper escaping of kid and azp fields in JWT tokens during OAuth2 authentication. When using local JWT validation with the posix fs driver, the vulnerability allows for path traversal using '../' sequences. The CVSS v3.1 base score is 5.5 (MEDIUM) according to NVD assessment with vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N, while MITRE assessed it at 7.5 (HIGH) with vector CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N (NVD).

Impact

If exploited, this vulnerability could allow a local attacker to validate tokens using arbitrary keys, potentially leading to unauthorized authentication and access to user emails. The vulnerability specifically impacts the confidentiality of the system by allowing access to sensitive authentication mechanisms (Openwall, Fedora Update).

Exploitability

The vulnerability requires local filesystem access to exploit. An attacker can trigger the vulnerability by placing a base64 encoded HS256 shared key in a location readable by dovecot and using '../../../../../location/to/path' as the key azp. This allows the attacker to forge tokens and authenticate as any valid user (Openwall).

Mitigation and workarounds

The vulnerability was fixed in Dovecot version 2.3.15. System administrators are advised to upgrade to this version or later to address the security issue. The fix includes proper escaping of kid and azp fields in JWT tokens (Dovecot Security, Gentoo Security).

Additional resources


SourceThis report was generated using AI

Related Dovecot vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-27851CRITICAL9.1
  • Dovecot logoDovecot
  • dovecot-debuginfo
NoYesMay 12, 2026
CVE-2026-40016MEDIUM6.5
  • Dovecot logoDovecot
  • dovecot24-fts
NoYesMay 12, 2026
CVE-2026-33603MEDIUM5.3
  • Dovecot logoDovecot
  • dovecot-pgsql-debuginfo
NoYesMay 12, 2026
CVE-2026-42006MEDIUM4.3
  • Dovecot logoDovecot
  • dovecot
NoYesMay 12, 2026
CVE-2026-40020MEDIUM4.3
  • Dovecot logoDovecot
  • dovecot22-backend-mysql
NoYesMay 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management