Skip to content

Commit

Permalink
(for 4.9.3) CVE-2018-14468/FRF.16: Add a missing length check.
Browse files Browse the repository at this point in the history
The specification says in a well-formed Magic Number information element
the data is exactly 4 bytes long. In mfr_print() check this before trying
to read those 4 bytes.

This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.

Add a test using the capture file supplied by the reporter(s).
  • Loading branch information
infrastation authored and fxlb committed Aug 18, 2019
1 parent 05a303c commit aa3e54f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions print-fr.c
Expand Up @@ -493,6 +493,11 @@ mfr_print(netdissect_options *ndo,
switch (ie_type) {

case MFR_CTRL_IE_MAGIC_NUM:
/* FRF.16.1 Section 3.4.3 Magic Number Information Element */
if (ie_len != 4) {
ND_PRINT((ndo, "(invalid length)"));
break;
}
ND_PRINT((ndo, "0x%08x", EXTRACT_32BITS(tptr)));
break;

Expand Down
1 change: 1 addition & 0 deletions tests/TESTLIST
Expand Up @@ -572,6 +572,7 @@ olsr-oobr-2 olsr-oobr-2.pcap olsr-oobr-2.out -v
ikev1_id_ipv6_addr_subnet-oobr ikev1_id_ipv6_addr_subnet-oobr.pcap ikev1_id_ipv6_addr_subnet-oobr.out -v
isakmp-various-oobr isakmp-various-oobr.pcap isakmp-various-oobr.out -v
aoe-oobr-1 aoe-oobr-1.pcap aoe-oobr-1.out -v -c1
frf16_magic_ie-oobr frf16_magic_ie-oobr.pcap frf16_magic_ie-oobr.out -v -c1

# bad packets from Katie Holly
mlppp-oobr mlppp-oobr.pcap mlppp-oobr.out
Expand Down
2 changes: 2 additions & 0 deletions tests/frf16_magic_ie-oobr.out
@@ -0,0 +1,2 @@
FRF.16 Control, Flags [Begin, End, Control], Unknown Message (0x00), length 3714318497
IE Magic Number (3), length 3: (invalid length)[|mfr]
Binary file added tests/frf16_magic_ie-oobr.pcap
Binary file not shown.

0 comments on commit aa3e54f

Please sign in to comment.