]> The Tcpdump Group git mirrors - tcpdump/commit
CVE-2017-13050/RPKI-Router: fix a few bugs
authorDenis Ovsienko <[email protected]>
Wed, 9 Aug 2017 18:51:09 +0000 (19:51 +0100)
committerDenis Ovsienko <[email protected]>
Sun, 3 Sep 2017 23:08:58 +0000 (00:08 +0100)
commit0c384810276380683e26709b932b3af5f3928ee0
tree6a700bb26c7a64875ba2a88df22fa7d7ce32f51c
parentc4816fd0a190d25db1ef413fc91253e484b3a7c4
CVE-2017-13050/RPKI-Router: fix a few bugs

The decoder didn't properly check that the PDU length stored in the PDU
header is correct. The only check in place was in rpki_rtr_print() and it
tested whether the length is zero but that is not sufficient. Make all
necessary length and bounds checks, both generic and type-specific, in
rpki_rtr_pdu_print() and reduce rpki_rtr_print() to a simple loop.

This also fixes a minor bug and PDU type 0 (Serial Notify from RFC 6810
Section 5.2) is valid again.

In rpki_rtr_pdu_print() any protocol version was considered version 0,
fix it to skip the rest of input if the PDU protocol version is unknown.

Ibid, the PDU type 10 (Error Report from RFC 6810 Section 5.10) case
block didn't consider the "Length of Error Text" data element mandatory,
put it right.

Ibid, when printing an encapsulated PDU, give itself (via recursion)
respective buffer length to make it possible to tell whether the
encapsulated PDU fits. Do not recurse deeper than 2nd level.

Update prior RPKI-Router test cases that now stop to decode earlier
because of the stricter checks.

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).
print-rpki-rtr.c
tests/TESTLIST
tests/kday2.out
tests/kday3.out
tests/kday4.out
tests/kday5.out
tests/kday7.out
tests/kday8.out
tests/rpki-rtr-oob.out [new file with mode: 0644]
tests/rpki-rtr-oob.pcap [new file with mode: 0644]