]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: Fix VU#270232, VPNv4 NLRI parser memcpys to stack on unchecked length
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 27 Jan 2016 16:54:45 +0000 (16:54 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 28 Mar 2016 12:55:18 +0000 (08:55 -0400)
commit50905aa278dbbd85ec3583bf6c67e42c9da1f0eb
treeafd9f4795839e3f152cce292b28820fda13743c3
parentc026ca1c01f688d0f6b8754cd2c5d3388f4e2162
bgpd: Fix VU#270232, VPNv4 NLRI parser memcpys to stack on unchecked length

Address CERT vulnerability report VU#270232, memcpy to stack data structure
based on length field from packet data whose length field upper-bound was
not properly checked.

This likely allows BGP peers that are enabled to send Labeled-VPN SAFI
routes to Quagga bgpd to remotely exploit Quagga bgpd.

Mitigation: Do not enable Labeled-VPN SAFI with untrusted neighbours.

Impact: Labeled-VPN SAFI is not enabled by default.

* bgp_mplsvpn.c: (bgp_nlri_parse_vpnv4) The prefixlen is checked for
  lower-bound, but not for upper-bound against received data length.
  The packet data is then memcpy'd to the stack based on the prefixlen.

  Extend the prefixlen check to ensure it is within the bound of the NLRI
  packet data AND the on-stack prefix structure AND the maximum size for the
  address family.

Reported-by: Kostya Kortchinsky <kostyak@google.com>
This commit a joint effort between:

Lou Berger <lberger@labn.net>
Donald Sharp <sharpd@cumulusnetworks.com>
Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org>
bgpd/bgp_mplsvpn.c