mailing list archives
tcpdump: off-by-one heap overflow in 802.11 printer
From: Moritz Jodeit <moritz () jodeit org>
Date: Thu, 1 Mar 2007 13:59:23 +0100
There's an off-by-one heap-overflow in the ieee802.11 printer,
which can be triggered by a maliciously crafted 802.11 frame.
The link type must have been explicitly specified for this to
The function parse_elements() in print-802_11.c checks the
length pbody->tim.length from the frame for too small values in
line 265, but then uses the wrong variable in the following
range check in line 267. Since pbody->tim.length is defined as
a u_int8_t it can hold a maximum value of 255, which in turn
would copy 252 bytes into pbody->tim.bitmap, which is only
251 bytes of size.
253 case E_TIM:
254 /* Present, possibly truncated */
255 pbody->tim_status = TRUNCATED;
256 if (!TTEST2(*(p + offset), 2))
258 memcpy(&pbody->tim, p + offset, 2);
259 offset += 2;
260 if (!TTEST2(*(p + offset), 3))
262 memcpy(&pbody->tim.count, p + offset, 3);
263 offset += 3;
265 if (pbody->tim.length <= 3)
267 if (pbody->rates.length > sizeof pbody->tim.bitmap)
269 if (!TTEST2(*(p + offset), pbody->tim.length - 3))
271 memcpy(pbody->tim.bitmap, p + (pbody->tim.length - 3),
272 (pbody->tim.length - 3))
The current tcpdump release 3.9.5 is still vulnerable.
This got fixed  in CVS Head and in the tcpdump_3_9 branch.
Full-Disclosure - We believe in it.
Hosted and sponsored by Secunia - http://secunia.com/
- tcpdump: off-by-one heap overflow in 802.11 printer Moritz Jodeit (Mar 01)