Bug 1188875 (CVE-2021-36386)

Summary: VUL-0: CVE-2021-36386: fetchmail: DoS or information disclosure in some configurations
Product: [Novell Products] SUSE Security Incidents Reporter: Robert Frohl <rfrohl>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: NEW --- QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: pmonrealgonzalez, smash_bz
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/305284/
Whiteboard: CVSSv3.1:SUSE:CVE-2021-36386:5.1:(AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L)
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Back-ported patch for SLE-11_Update

Description Robert Frohl 2021-07-29 07:12:19 UTC
CVE-2021-36386

ANNOUNCE: fetchmail <= 6.4.19 security announcement 2021-01 (CVE-2021-36386) - fetchmail 6.4.20 released. DoS or information disclosure in some configurations



From: Matthias Andree 
Date: Wed, 28 Jul 2021 23:27:00 +0200


Greetings,

I have announced fetchmail 6.4.20 today, which fixes the issue shown in 
the security announcement below.

fetchmail 6.4.20 is available from.

The source archive is available at:


Detached GnuPG signatures for the respective tarballs are at:

SHA256 hash values for the tarballs:
SHA256(fetchmail-6.4.20.tar.lz)= 497973353c0538216e7d7f2289a21d9acc5edd78f06d7ec008001f4f19e91b11
SHA256(fetchmail-6.4.20.tar.xz)= c82141ae2e8f0039ceb0c5c2eda43c5e93ad0bf7f9c6bb628092b3be74386176

------------------------------------------------------------------------------------------------
fetchmail-SA-2021-01: DoS or information disclosure logging long messages

Topics:         fetchmail denial of service or information disclosure when logging long messages

Author:         Matthias Andree
Version:        1.1
Announced:      2021-07-28
Type:           missing variable initialization can cause read from bad memory 
                locations
Impact:         fetchmail logs random information, or segfaults and aborts, 
                stalling inbound mail
Danger:         low
Acknowledgment: Christian Herdtweck, Intra2net AG, Tübingen, Germany
                for analysis and report and a patch suggestion

CVE Name:       CVE-2021-36386
URL:            https://www.fetchmail.info/fetchmail-SA-2021-01.txt
Project URL:    https://www.fetchmail.info/

Affects:        - fetchmail releases up to and including 6.4.19

Not affected:   - fetchmail releases 6.4.20 and newer

Corrected in:   c546c829 Git commit hash

                2021-07-28 fetchmail 6.4.20 release tarball


0. Release history
==================

2021-07-07      initial report to maintainer
2021-07-28 1.0  release
2021-07-28 1.1  update Git commit hash with correction


1. Background
=============

fetchmail is a software package to retrieve mail from remote POP3, IMAP,
ETRN or ODMR servers and forward it to local SMTP, LMTP servers or
message delivery agents. fetchmail supports SSL and TLS security layers
through the OpenSSL library, if enabled at compile time and if also
enabled at run time, in both SSL/TLS-wrapped mode on dedicated ports as
well as in-band-negotiated "STARTTLS" and "STLS" modes through the
regular protocol ports.


2. Problem description and Impact
=================================

Fetchmail has long had support to assemble log/error messages that are 
generated piecemeal, and takes care to reallocate the output buffer as needed.  
In the reallocation case, i. e. when long log messages are assembled that can 
stem from very long headers, and on systems that have a varargs.h/stdarg.h 
interface (all modern systems), fetchmail's code would fail to reinitialize 
the va_list argument to vsnprintf. 

The exact effects depend on the verbose mode (how many -v are given) of 
fetchmail, computer architecture, compiler, operating system and 
configuration.  On some systems, the code just works without ill effects, some 
systems log a garbage message (potentially disclosing sensitive information), 
some systems log literally "(null)", some systems trigger SIGSEGV (signal 
#11), which crashes fetchmail, causing a denial of service on fetchmail's end.


3. Solution
===========

Install fetchmail 6.4.20 or newer.

The fetchmail source code is available from
.

Distributors are encouraged to review the NEWS file and move forward to 
6.4.20, rather than backport individual security fixes, because doing so 
routinely misses other fixes crucial to fetchmail's proper operation, 
for which no security announcements are issued, or documentation,
or translation updates.

Fetchmail 6.4.X releases have been made with a focus on unchanged user and 
program interfaces so as to avoid disruptions when upgrading from 6.3.Z or 
6.4.X to 6.4.Y with Y > X.  Care was taken to not change the interface 
incompatibly.


A. Copyright, License and Non-Warranty
======================================

(C) Copyright 2021 by Matthias Andree, .
Some rights reserved.

fetchmail-SA-2021-01 © 2021 by Matthias Andree is licensed under CC 
BY-ND 4.0. To view a copy of this license, visit 
http://creativecommons.org/licenses/by-nd/4.0/

THIS WORK IS PROVIDED FREE OF CHARGE AND WITHOUT ANY WARRANTIES.
Use the information herein at your own risk.

END of fetchmail-SA-2021-01


References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-36386
http://seclists.org/oss-sec/2021/q3/56
Comment 2 Robert Frohl 2021-07-29 07:20:19 UTC
tracking these as affected:

- SUSE:SLE-11:Update/fetchmail
- SUSE:SLE-12:Update/fetchmail
- SUSE:SLE-15:Update/fetchmail

and Factory
Comment 3 Pedro Monreal Gonzalez 2021-07-29 08:48:04 UTC
Factory update to 6.4.20: https://build.opensuse.org/request/show/909104
Comment 4 Pedro Monreal Gonzalez 2021-07-29 09:38:33 UTC
For SLE-11_Update, the follosing commit is also required for back-port:
   https://gitlab.com/fetchmail/fetchmail/-/commit/414a380974f78d0bb62ca953398bf1f54b28a58d
Comment 6 Pedro Monreal Gonzalez 2021-07-29 11:43:51 UTC
Created attachment 851400 [details]
Back-ported patch for SLE-11_Update

Contains also the commit mentioned in c#4.
Comment 7 Pedro Monreal Gonzalez 2021-07-29 11:45:42 UTC
Submitted also to SLE-11_Update in sr#247378.
Comment 11 Swamp Workflow Management 2021-08-18 13:20:00 UTC
SUSE-SU-2021:2771-1: An update that solves one vulnerability and has three fixes is now available.

Category: security (moderate)
Bug References: 1033081,1182807,1188034,1188875
CVE References: CVE-2021-36386
JIRA References: 
Sources used:
SUSE OpenStack Cloud Crowbar 9 (src):    fetchmail-6.3.26-13.12.1
SUSE OpenStack Cloud 9 (src):    fetchmail-6.3.26-13.12.1
SUSE OpenStack Cloud 8 (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server for SAP 12-SP4 (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server for SAP 12-SP3 (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server 12-SP5 (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server 12-SP4-LTSS (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server 12-SP3-LTSS (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server 12-SP3-BCL (src):    fetchmail-6.3.26-13.12.1
SUSE Linux Enterprise Server 12-SP2-BCL (src):    fetchmail-6.3.26-13.12.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 12 Swamp Workflow Management 2021-08-20 13:35:10 UTC
# maintenance_jira_update_notice
SUSE-SU-2021:2791-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 1188034,1188875
CVE References: CVE-2021-36386
JIRA References: 
Sources used:
SUSE Manager Server 4.0 (src):    fetchmail-6.3.26-20.14.1
SUSE Manager Retail Branch Server 4.0 (src):    fetchmail-6.3.26-20.14.1
SUSE Manager Proxy 4.0 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Server for SAP 15-SP1 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Server for SAP 15 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Server 15-SP1-LTSS (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Server 15-SP1-BCL (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Server 15-LTSS (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP3 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP2 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise Module for Basesystem 15-SP2 (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise High Performance Computing 15-SP1-LTSS (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise High Performance Computing 15-SP1-ESPOS (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise High Performance Computing 15-LTSS (src):    fetchmail-6.3.26-20.14.1
SUSE Linux Enterprise High Performance Computing 15-ESPOS (src):    fetchmail-6.3.26-20.14.1
SUSE Enterprise Storage 6 (src):    fetchmail-6.3.26-20.14.1
SUSE CaaS Platform 4.0 (src):    fetchmail-6.3.26-20.14.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 13 Swamp Workflow Management 2021-08-20 13:36:20 UTC
# maintenance_jira_update_notice
openSUSE-SU-2021:2791-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 1188034,1188875
CVE References: CVE-2021-36386
JIRA References: 
Sources used:
openSUSE Leap 15.3 (src):    fetchmail-6.3.26-20.14.1
Comment 14 Swamp Workflow Management 2021-08-23 19:16:45 UTC
# maintenance_jira_update_notice
openSUSE-SU-2021:1183-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 1188034,1188875
CVE References: CVE-2021-36386
JIRA References: 
Sources used:
openSUSE Leap 15.2 (src):    fetchmail-6.3.26-lp152.6.6.1
Comment 17 Swamp Workflow Management 2021-12-14 11:19:31 UTC
openSUSE-SU-2021:4018-1: An update that solves two vulnerabilities, contains three features and has four fixes is now available.

Category: security (moderate)
Bug References: 1152964,1174075,1181400,1188875,1190069,1190896
CVE References: CVE-2021-36386,CVE-2021-39272
JIRA References: SLE-17903,SLE-18059,SLE-18159
Sources used:
openSUSE Leap 15.3 (src):    fetchmail-6.4.22-20.20.1
Comment 18 Swamp Workflow Management 2021-12-14 11:24:32 UTC
SUSE-SU-2021:4018-1: An update that solves two vulnerabilities, contains three features and has four fixes is now available.

Category: security (moderate)
Bug References: 1152964,1174075,1181400,1188875,1190069,1190896
CVE References: CVE-2021-36386,CVE-2021-39272
JIRA References: SLE-17903,SLE-18059,SLE-18159
Sources used:
SUSE Linux Enterprise Server for SAP 15-SP1 (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Server for SAP 15 (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Server 15-SP1-LTSS (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Server 15-SP1-BCL (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Server 15-LTSS (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP3 (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP2 (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Module for Basesystem 15-SP3 (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise Module for Basesystem 15-SP2 (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise High Performance Computing 15-SP1-LTSS (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise High Performance Computing 15-SP1-ESPOS (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise High Performance Computing 15-LTSS (src):    fetchmail-6.4.22-20.20.1
SUSE Linux Enterprise High Performance Computing 15-ESPOS (src):    fetchmail-6.4.22-20.20.1
SUSE Enterprise Storage 6 (src):    fetchmail-6.4.22-20.20.1
SUSE CaaS Platform 4.0 (src):    fetchmail-6.4.22-20.20.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 19 Swamp Workflow Management 2021-12-17 14:18:47 UTC
openSUSE-SU-2021:1591-1: An update that solves two vulnerabilities, contains three features and has four fixes is now available.

Category: security (moderate)
Bug References: 1152964,1174075,1181400,1188875,1190069,1190896
CVE References: CVE-2021-36386,CVE-2021-39272
JIRA References: SLE-17903,SLE-18059,SLE-18159
Sources used:
openSUSE Leap 15.2 (src):    fetchmail-6.4.22-lp152.6.12.1