]> Pileus Git - ~andy/fetchmail/blob - fetchmail-SA-2005-01.txt
Revise.
[~andy/fetchmail] / fetchmail-SA-2005-01.txt
1 fetchmail-SA-2005-01: security announcement
2
3 Topic:          remote code injection vulnerability in fetchmail
4
5 Author:         Matthias Andree
6 Version:        1.01
7 Announced:      2005-07-21
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 CVE Name:       CAN-2005-2335
14 URL:            http://fetchmail.berlios.de/fetchmail-SA-2005-01.txt
15                 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=212762
16                 http://www.vuxml.org/freebsd/3497d7be-2fef-45f4-8162-9063751b573a.html
17                 http://www.freebsd.org/cgi/query-pr.cgi?pr=83805
18 Thanks:         Edward J. Shornock (located the bug in UIDL code)
19                 Miloslav Trmac (pointed out 6.2.5.1 was faulty)
20                 Ludwig Nussel (provided minimal fix)
21
22 Affects:        fetchmail version 6.2.5.1 (denial of service)
23                 fetchmail version 6.2.5 (code injection)
24                 fetchmail version 6.2.0 (code injection)
25                 (other versions have not been checked)
26
27 Not affected:   fetchmail 6.2.5.2
28                 fetchmail 6.2.6-pre6
29                 fetchmail 6.3.0      (not released yet)
30
31                 Older versions may not have THIS bug, but had been found
32                 to contain other security-relevant bugs.
33
34 Corrected:      2005-07-22 01:37 UTC (SVN) - committed bugfix (r4157)
35                 2005-07-22                   fetchmail-patch-6.2.5.2 released
36
37 0. Release history
38
39 2005-07-20      1.00 - Initial announcement
40 2005-07-22      1.01 - Withdrew 6.2.5.1 and 6.2.6-pre5, the fix was buggy
41                        and susceptible to denial of service through
42                        single-byte read from 0 when either a Message-ID:
43                        header was empty or the UIDL response did not
44                        contain an URL.
45                      - Add Credits.
46                      - Add 6.2.5.1 failure details to sections 2 and 3
47                      - Revise section 5 and B.
48
49 1. Background
50
51 fetchmail is a software package to retrieve mail from remote POP2, POP3,
52 IMAP, ETRN or ODMR servers and forward it to local SMTP, LMTP servers or
53 message delivery agents.
54
55 2. Problem description
56
57 The POP3 code in fetchmail-6.2.5 and older that deals with UIDs (from
58 the UIDL) reads the responses returned by the POP3 server into
59 fixed-size buffers allocated on the stack, without limiting the input
60 length to the buffer size. A compromised or malicious POP3 server can
61 thus overrun fetchmail's stack.  This affects POP3 and all of its
62 variants, for instance but not limited to APOP.
63
64 In fetchmail-6.2.5.1, the attempted fix prevented code injection via
65 POP3 UIDL, but introduced two possible NULL dereferences that can be
66 exploited to mount a denial of service attack.
67
68 3. Impact
69
70 In fetchmail-6.2.5 and older, very long UIDs can cause fetchmail to
71 crash, or potentially make it execute code placed on the stack. In some
72 configurations, fetchmail is run by the root user to download mail for
73 multiple accounts.
74
75 In fetchmail-6.2.5.1, a server that responds with UID lines containing
76 only the article number but no UID (in violation of RFC-1939), or a
77 message without Message-ID when no UIDL support is available, can crash
78 fetchmail.
79
80 4. Workaround
81
82 No reasonable workaround can be offered at this time.
83
84 5. Solution
85
86 Upgrade your fetchmail package to version 6.2.5.2.
87
88 This requires the download of the fetchmail-6.2.5.tar.gz tarball and the
89 fetchmail-patch-6.2.5.2.gz from BerliOS:
90
91 <http://developer.berlios.de/project/showfiles.php?group_id=1824>
92
93 To use the patch:
94
95   1. download fetchmail-6.2.5.tar.gz (or retrieve the version you already
96      had downloaded) and fetchmail-patch-6.2.5.2.tar.gz
97   2. unpack the tarball: gunzip -c fetchmail-6.2.5.tar.gz | tar xf -
98   3. unpack the patch: gunzip fetchmail-patch-6.2.5.2.gz
99   4. apply the patch: cd fetchmail-6.2.5 ; patch -p1 <../fetchmail-patch-6.2.5.2
100   5. now configure and build as usual - detailed instructions in the file
101      named "INSTALL".
102
103 A. References
104
105 fetchmail home page: <http://fetchmail.berlios.de/>
106
107 B. Copyright, License and Warranty
108
109 (C) Copyright 2005 by Matthias Andree, <matthias.andree@gmx.de>.
110 Some rights reserved.
111
112 This work is licensed under the Creative Commons
113 Attribution-NonCommercial-NoDerivs German License. To view a copy of
114 this license, visit http://creativecommons.org/licenses/by-nc-nd/2.0/de/
115 or send a letter to Creative Commons; 559 Nathan Abbott Way;
116 Stanford, California 94305; USA.
117
118 THIS WORK IS PROVIDED FREE OF CHARGE AND WITHOUT ANY WARRANTIES.
119 Use the information herein at your own risk.
120
121 END OF fetchmail-SA-2005-01.txt