Skip to content

Commit

Permalink
CVE-2017-13038/PPP: Do bounds checking.
Browse files Browse the repository at this point in the history
This fixes a buffer over-read discovered by Brian 'geeknik' Carpenter.

Add a test using the capture file supplied by Katie Holly.
  • Loading branch information
guyharris authored and infrastation committed Sep 13, 2017
1 parent 3cb7c9a commit 7335163
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions print-ppp.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,15 @@ handle_mlppp(netdissect_options *ndo,
if (!ndo->ndo_eflag)
ND_PRINT((ndo, "MLPPP, "));

if (length < 2) {
ND_PRINT((ndo, "[|mlppp]"));
return;
}
if (!ND_TTEST_16BITS(p)) {
ND_PRINT((ndo, "[|mlppp]"));
return;
}

ND_PRINT((ndo, "seq 0x%03x, Flags [%s], length %u",
(EXTRACT_16BITS(p))&0x0fff, /* only support 12-Bit sequence space for now */
bittok2str(ppp_ml_flag_values, "none", *p & 0xc0),
Expand Down
3 changes: 3 additions & 0 deletions tests/TESTLIST
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ radius_attr_asan radius_attr_asan.pcap radius_attr_asan.out -v
ospf6_decode_v3_asan ospf6_decode_v3_asan.pcap ospf6_decode_v3_asan.out -v
ip_ts_opts_asan ip_ts_opts_asan.pcap ip_ts_opts_asan.out -v

# bad packets from Katie Holly
mlppp-oobr mlppp-oobr.pcap mlppp-oobr.out

# RTP tests
# fuzzed pcap
rtp-seg-fault-1 rtp-seg-fault-1.pcap rtp-seg-fault-1.out -v -T rtp
Expand Down
1 change: 1 addition & 0 deletions tests/mlppp-oobr.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MLPPP, [|mlppp]
Binary file added tests/mlppp-oobr.pcap
Binary file not shown.

0 comments on commit 7335163

Please sign in to comment.