]> Pileus Git - ~andy/fetchmail/blob - fetchmail-SA-2010-01.txt
Credit John Beck's fixes.
[~andy/fetchmail] / fetchmail-SA-2010-01.txt
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 fetchmail-SA-2010-01: Heap overrun in verbose SSL cert' info display.
5
6 Topics:         Heap overrun in verbose SSL certificate information display.
7
8 Author:         Matthias Andree
9 Version:        1.0
10 Announced:      2010-02-05
11 Type:           malloc() Buffer overrun with printable characters
12 Impact:         Code injection (difficult).
13 Danger:         low
14
15 CVE Name:       CVE-2010-0562
16 CVSSv2:         (AV:N/AC:H/Au:N/C:N/I:C/A:P/E:U/RL:O/RC:C) proposed
17 URL:            http://www.fetchmail.info/fetchmail-SA-2010-01.txt
18 Project URL:    http://www.fetchmail.info/
19
20 Affects:        fetchmail releases 6.3.11, 6.3.12, and 6.3.13
21
22 Not affected:   fetchmail release 6.3.14 and newer
23
24 Corrected:      2010-02-04 fetchmail SVN (r5467)
25                            Git (f1c7607615ebd48807db6170937fe79bb89d47d4)
26                 2010-02-05 fetchmail release 6.3.14
27
28
29 0. Release history
30 ==================
31
32 2010-02-04 0.1  first draft (visible in SVN and through oss-security)
33 2010-02-05 1.0  fixed signed/unsigned typo (found by Nico Golde)
34 2010-02-09 1.1  added CVE/CVSS, Announced: date
35
36
37 1. Background
38 =============
39
40 fetchmail is a software package to retrieve mail from remote POP2, POP3,
41 IMAP, ETRN or ODMR servers and forward it to local SMTP, LMTP servers or
42 message delivery agents. It supports SSL and TLS security layers through
43 the OpenSSL library, if enabled at compile time and if also enabled at
44 run time.
45
46
47 2. Problem description and Impact
48 =================================
49
50 In verbose mode, fetchmail prints X.509 certificate subject and issuer
51 information to the user, and counts and allocates a malloc() buffer for
52 that purpose.
53
54 If the material to be displayed contains characters with high bit set
55 and the platform treats the "char" type as signed, this can cause a heap
56 buffer overrun because non-printing characters are escaped as
57 \xFF..FFnn, where nn is 80..FF in hex.
58
59 This might be exploitable to inject code if
60 - - fetchmail is run in verbose mode
61 AND
62 - - the host running fetchmail considers char signed
63 AND
64 - - the server uses malicious certificates with non-printing characters
65   that have the high bit set
66 AND
67 - - these certificates manage to inject shell-code that consists purely of
68   printable characters.
69
70 It is believed to be difficult to achieve all this.
71
72
73 3. Solution
74 ===========
75
76 There are two alternatives, either of them by itself is sufficient:
77
78 a. Apply the patch found in section B of this announcement to
79    fetchmail 6.3.13, recompile and reinstall it.
80
81 b. Install fetchmail 6.3.14 or newer after it will have become available.
82    The fetchmail source code is always available from
83    <http://developer.berlios.de/project/showfiles.php?group_id=1824>.
84
85
86 4. Workaround
87 =============
88
89 Run fetchmail without and verbose options.
90
91
92 A. Copyright, License and Warranty
93 ==================================
94
95 (C) Copyright 2010 by Matthias Andree, <matthias.andree@gmx.de>.
96 Some rights reserved.
97
98 This work is licensed under the
99 Creative Commons Attribution-NoDerivs 3.0 Germany License (CC BY-ND 3.0).
100
101 To view a copy of this license, visit
102 http://creativecommons.org/licenses/by-nd/3.0/de/deed.en
103 or send a letter to:
104
105 Creative Commons
106 444 Castro Street
107 Suite 900
108 MOUNTAIN VIEW, CALIFORNIA 94041
109 USA
110
111
112 THIS WORK IS PROVIDED FREE OF CHARGE AND WITHOUT ANY WARRANTIES.
113 Use the information herein at your own risk.
114
115
116 B. Patch to remedy the problem
117 ==============================
118
119 Note that when taking this from a GnuPG clearsigned file, the lines
120 starting with a "-" character are prefixed by another "- " (dash +
121 blank) combination. Either feed this file through GnuPG to strip them,
122 or strip them manually. You may want to use the "-p1" flag to patch.
123
124 Whitespace differences can usually be ignored by invoking "patch -l",
125 so try this if the patch does not apply.
126
127 - --- a/sdump.c
128 +++ b/sdump.c
129 @@ -36,7 +36,7 @@ char *sdump(const char *in, size_t len)
130         if (isprint((unsigned char)in[i])) {
131             *(oi++) = in[i];
132         } else {
133 - -         oi += sprintf(oi, "\\x%02X", in[i]);
134 +           oi += sprintf(oi, "\\x%02X", (unsigned char)in[i]);
135         }
136      }
137      *oi = '\0';
138
139 END OF fetchmail-SA-2010-01.txt
140 -----BEGIN PGP SIGNATURE-----
141 Version: GnuPG v1.4.11 (GNU/Linux)
142
143 iEYEARECAAYFAk9/Yg4ACgkQvmGDOQUufZX0pACg7jUxqFQzdhdVDXk/izXBNkfg
144 ZBgAnAhDK4mYPoCzoiaJhEHM6rET4W+v
145 =AX1N
146 -----END PGP SIGNATURE-----