1 fetchmail-SA-2005-01: security announcement
3 Topic: remote code injection vulnerability in fetchmail
5 Author: Matthias Andree
8 Type: buffer overrun/stack corruption/code injection
9 Impact: account or system compromise possible through malicious
10 or compromised POP3 servers
11 Danger: high: in sensitive configurations, a full system
12 compromise is possible
13 (for 6.2.5.1: denial of service for the whole fetchmail
15 CVE Name: CVE-2005-2335
16 URL: http://fetchmail.berlios.de/fetchmail-SA-2005-01.txt
17 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212762
18 http://www.vuxml.org/freebsd/3497d7be-2fef-45f4-8162-9063751b573a.html
19 http://www.vuxml.org/freebsd/3f4ac724-fa8b-11d9-afcf-0060084a00e5.html
20 http://www.freebsd.org/cgi/query-pr.cgi?pr=83805
21 http://www.heise.de/security/news/meldung/62070
22 Thanks: Edward J. Shornock (located the bug in UIDL code)
23 Miloslav Trmac (pointed out 6.2.5.1 was faulty)
24 Ludwig Nussel (provided minimal correct fix)
26 Affects: fetchmail version 6.2.5.1 (denial of service)
27 fetchmail version 6.2.5 (code injection)
28 fetchmail version 6.2.0 (code injection)
29 (other versions have not been checked)
31 Not affected: fetchmail 6.2.5.2
35 Older versions may not have THIS bug, but had been found
36 to contain other security-relevant bugs.
38 Corrected: 2005-07-22 01:37 UTC (SVN) - committed bugfix (r4157)
39 2005-07-22 fetchmail-patch-6.2.5.2 released
40 2005-07-23 fetchmail-6.2.5.2 tarball released
41 2005-11-13 fetchmail-6.2.5.4 tarball released
42 2005-11-30 fetchmail-6.3.0 tarball released
46 2005-07-20 1.00 - Initial announcement
47 2005-07-22 1.01 - Withdrew 6.2.5.1 and 6.2.6-pre5, the fix was buggy
48 and susceptible to denial of service through
49 single-byte read from 0 when either a Message-ID:
50 header was empty (in violation of RFC-822/2822)
51 or the UIDL response did not contain an UID (in
52 violation of RFC-1939).
54 - Add 6.2.5.1 failure details to sections 2 and 3
55 - Revise section 5 and B.
56 2005-07-26 1.02 - Revise section 0.
57 - Add FreeBSD VuXML URL for 6.2.5.1.
58 - Add heise security URL.
59 - Mention release of 6.2.5.2 tarball.
60 2005-10-27 1.03 - Update CVE Name after CVE naming change
61 2005-12-08 1.04 - Mention 6.2.5.4 and 6.3.0 releases "not affected"
62 - remove patch information
66 fetchmail is a software package to retrieve mail from remote POP2, POP3,
67 IMAP, ETRN or ODMR servers and forward it to local SMTP, LMTP servers or
68 message delivery agents.
70 2. Problem description
72 The POP3 code in fetchmail-6.2.5 and older that deals with UIDs (from
73 the UIDL) reads the responses returned by the POP3 server into
74 fixed-size buffers allocated on the stack, without limiting the input
75 length to the buffer size. A compromised or malicious POP3 server can
76 thus overrun fetchmail's stack. This affects POP3 and all of its
77 variants, for instance but not limited to APOP.
79 In fetchmail-6.2.5.1, the attempted fix prevented code injection via
80 POP3 UIDL, but introduced two possible NULL dereferences that can be
81 exploited to mount a denial of service attack.
85 In fetchmail-6.2.5 and older, very long UIDs can cause fetchmail to
86 crash, or potentially make it execute code placed on the stack. In some
87 configurations, fetchmail is run by the root user to download mail for
90 In fetchmail-6.2.5.1, a server that responds with UID lines containing
91 only the article number but no UID (in violation of RFC-1939), or a
92 message without Message-ID when no UIDL support is available, can crash
97 No reasonable workaround can be offered at this time.
101 Upgrade your fetchmail package to version 6.3.0 or newer.
103 <http://developer.berlios.de/project/showfiles.php?group_id=1824>
107 fetchmail home page: <http://fetchmail.berlios.de/>
109 B. Copyright, License and Warranty
111 (C) Copyright 2005 by Matthias Andree, <matthias.andree@gmx.de>.
112 Some rights reserved.
114 This work is licensed under the Creative Commons
115 Attribution-NonCommercial-NoDerivs German License. To view a copy of
116 this license, visit http://creativecommons.org/licenses/by-nc-nd/2.0/de/
117 or send a letter to Creative Commons; 559 Nathan Abbott Way;
118 Stanford, California 94305; USA.
120 THIS WORK IS PROVIDED FREE OF CHARGE AND WITHOUT ANY WARRANTIES.
121 Use the information herein at your own risk.
123 END OF fetchmail-SA-2005-01.txt