GoBGP AIGP Attribute Parser Buffer Overflow Vulnerability
A remote buffer overflow vulnerability exists in osrg GoBGP up to version 4.3.0 within the PathAttributeAigp.DecodeFromBytes function, allowing attackers to potentially execute arbitrary code by manipulating the AIGP Attribute Parser.
A buffer overflow vulnerability has been identified in the osrg GoBGP software, specifically affecting versions up to 4.3.0. The vulnerability resides in the PathAttributeAigp.DecodeFromBytes function of the pkg/packet/bgp/bgp.go file, which is part of the AIGP Attribute Parser component. An attacker can remotely trigger this vulnerability by sending a crafted BGP message containing a malicious AIGP attribute. Successful exploitation could lead to arbitrary code execution on the affected system. GoBGP is an open source BGP implementation. Organizations using GoBGP for routing purposes should upgrade to version 4.4.0 or apply the provided patch (51ad1ada06cb41ce47b7066799981816f50b7ced) to mitigate this risk.
Attack Chain
- Attacker identifies a GoBGP instance running a vulnerable version (<= 4.3.0).
- Attacker crafts a malicious BGP update message containing a specially crafted AIGP attribute.
- The crafted AIGP attribute is designed to trigger a buffer overflow in the
PathAttributeAigp.DecodeFromBytesfunction. - The attacker sends the malicious BGP update message to the vulnerable GoBGP instance over TCP port 179.
- The GoBGP instance receives the message and attempts to parse the AIGP attribute using the vulnerable function.
- The
PathAttributeAigp.DecodeFromBytesfunction fails to properly validate the size of the input data, leading to a buffer overflow. - The buffer overflow overwrites adjacent memory regions, potentially including critical program data or executable code.
- The attacker leverages the memory corruption to execute arbitrary code on the GoBGP instance, gaining control of the system.
Impact
Successful exploitation of this vulnerability allows a remote attacker to execute arbitrary code on the affected GoBGP instance. This can lead to a complete compromise of the routing infrastructure, allowing the attacker to intercept, modify, or disrupt network traffic. In service provider environments, this could affect a large number of customers and cause significant network outages. Given the CVSS v3.1 score of 7.3, this is considered a high-severity vulnerability.
Recommendation
- Upgrade to GoBGP version 4.4.0 to remediate the vulnerability as mentioned in the overview.
- Apply the patch
51ad1ada06cb41ce47b7066799981816f50b7cedto the affected component to mitigate the vulnerability if upgrading is not immediately possible. - Monitor network traffic for BGP update messages with unusually large or malformed AIGP attributes, using a network intrusion detection system.
- Deploy the Sigma rule detecting connections to port 179 from unusual sources to identify potentially malicious hosts attempting to exploit the vulnerability.
- Review and harden BGP configuration to limit accepted peer connections to trusted sources only.
Detection coverage 2
Detect Connection Attempts to BGP Port from Unusual Sources
lowDetects connection attempts to the BGP port (179) from IP addresses not in the known BGP peers list.
Detect large packets to BGP port
mediumDetects unusually large network packets to BGP port which could indicate an attempt to overflow buffer
Detection queries are kept inside the platform. Get full rules →