CVE-2026-41643: Github.com/osrg/gobgp/v4 Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-8rxh-r2p6-7f2q
CVSS 7.5
CWE-129
Published
Advisory Summary

CVE-2026-41643 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-129: Improper Validation of Array Index) affecting Github.com/osrg/gobgp/v4 libraries in the Go ecosystem. The issue involves gobgp has remote denial of service (panic) in updatepathattrs4byteas via malformed bgp update. Remediation is available by upgrading affected packages to version 4.3.0.

CVE-2026-41643 at a Glance

CVE Identifier CVE-2026-41643
GHSA Identifier GHSA-8rxh-r2p6-7f2q
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-129: Improper Validation of Array Index
Affected Product Github.com/osrg/gobgp/v4
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-41643

To remediate this vulnerability, upgrade all affected Github.com/osrg/gobgp/v4 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/osrg/gobgp/v4 fixed: 4.3.0
Upgrade github.com/osrg/gobgp/v4 to 4.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/osrg/gobgp/v4

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-41643, inspect your project dependencies for Github.com/osrg/gobgp/v4:

inspect dependencies for github.com/osrg/gobgp/v4

Analyze the terminal output to locate any version of Github.com/osrg/gobgp/v4 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-129: Improper Validation of Array Index, where the product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array. In Github.com/osrg/gobgp/v4, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A remote Denial of Service (DoS) vulnerability exists in GoBGP where a malformed BGP UPDATE message can trigger a runtime error: index out of range panic. This occurs during the processing of 4-byte AS attributes when the message structure causes an internal slice index shift that is not properly handled. ### Details The vulnerability is located in internal/pkg/table/message.go within the UpdatePathAttrs4ByteAs function. When GoBGP processes a BGP UPDATE message containing both an AS_PATH and an AS4_PATH attribute, it attempts to merge or validate them to support 4-byte AS numbers. If the attributes are ordered such that AS4_PATH (Type 17) appears before AS_PATH (Type 2), and the AS4_PATH is deemed invalid/malformed, the code attempts to remove the AS4_PATH attribute from the msg.PathAttributes slice. It appears the crash happens due to an index shift in msg.PathAttributes: ``` #GoBGP v4.2.0 // Line 112: If AS4_PATH precedes AS_PATH, the deletion causes all subsequent attributes to shift left. msg.PathAttributes = append(msg.PathAttributes[:as4AttrPos], msg.PathAttributes[as4AttrPos+1:]...) // Line 206: The stale asAttrPos index is used here. //The function continues to use the stale index (asAttrPos) to update the AS_PATH. Since the slice length has decreased, accessing the old index leads to a panic. msg.PathAttributes[asAttrPos] = bgp.NewPathAttributeAsPath(newIntfParams) ``` This deletion causes all subsequent attributes in the slice to shift left by one position. However, the function continues to use the original asAttrPos index (calculated before the deletion) to access or modify the AS_PATH attribute later at [Line 206](https://www.google.com/search?q=https://github.com/osrg/gobgp/blob/v4.2.0/internal/pkg/table/message.go%23L206). Because the slice is now shorter, the "stale" index points out of bounds, triggering a panic and crashing the entire GoBGP process. ### PoC Environment: * GoBGP version: 4.2.0 Configuration: Passive peering enabled. Reproduction Steps: Configure GoBGP with a neighbor (e.g., 192.168.31.195). Send a specially crafted BGP UPDATE hex payload: ``` ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 22 02 00 00 # Withdrawn Routes Length 00 0b # Total Path Attribute Length 40 11 01 02 # AS4_PATH (Type 17, Len 1, Val 02) - Triggers the bug 40 02 04 ff ff de ad # AS_PATH (Type 2, Len 4) ``` The GoBGP process will immediately crash with: panic: runtime error: index out of range [1] with length 1. ### Impact Vulnerability Type: Remote Denial of Service (DoS). Impacted Users: Any GoBGP deployment (v4.2.0 and earlier) that accepts BGP UPDATE messages from peers. Since this crash occurs in the FSM (Finite State Machine) handling loop, a single malicious peer or a malformed route propagated through a transit provider can consistently crash the BGP daemon, leading to a complete loss of routing capabilities.

CVE-2026-41643 Affected Github.com/osrg/gobgp/v4 Versions

1 component(s)
Fixed Versions:
4.3.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/osrg/gobgp/v4
Go
< 4.3.0
4.3.0

References

Frequently Asked Questions

What is CVE-2026-41643?
CVE-2026-41643 is a security vulnerability in Github.com/osrg/gobgp/v4 involving GoBGP has Remote Denial of Service (Panic) in UpdatePathAttrs4ByteAs via Malformed BGP UPDATE under CWE-129: Improper Validation of Array Index.
Which Github.com/osrg/gobgp/v4 versions are affected?
Affected versions include releases prior to 4.3.0 across affected packages: github.com/osrg/gobgp/v4.
What version fixes CVE-2026-41643?
Upgrading to 4.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/osrg/gobgp/v4 affected?
Yes, github.com/osrg/gobgp/v4 is affected in releases prior to 4.3.0. Upgrade your dependency to 4.3.0 or later.
What is the CVSS score of CVE-2026-41643?
CVE-2026-41643 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-41643?
CVE-2026-41643 is classified under CWE-129: Improper Validation of Array Index (The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.).
How can I check Go dependencies for CVE-2026-41643?
Run the dependency tree command: 'inspect dependencies for github.com/osrg/gobgp/v4'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8rxh-r2p6-7f2q",
  "modified" : "2026-05-08T20:42:30Z",
  "published" : "2026-04-29T20:44:04Z",
  "aliases" : [ "CVE-2026-41643" ],
  "summary" : "GoBGP has Remote Denial of Service (Panic) in UpdatePathAttrs4ByteAs via Malformed BGP UPDATE",
  "details" : "### Summary\nA remote Denial of Service (DoS) vulnerability exists in GoBGP where a malformed BGP UPDATE message can trigger a runtime error: index out of range panic. This occurs during the processing of 4-byte AS attributes when the message structure causes an internal slice index shift that is not properly handled.\n\n### Details\nThe vulnerability is located in internal/pkg/table/message.go within the UpdatePathAttrs4ByteAs function.\n\nWhen GoBGP processes a BGP UPDATE message containing both an AS_PATH and an AS4_PATH attribute, it attempts to merge or validate them to support 4-byte AS numbers. If the attributes are ordered such that AS4_PATH (Type 17) appears before AS_PATH (Type 2), and the AS4_PATH is deemed invalid/malformed, the code attempts to remove the AS4_PATH attribute from the msg.PathAttributes slice.\nIt appears the crash happens due to an index shift in msg.PathAttributes:\n```\n#GoBGP v4.2.0\n// Line 112: If AS4_PATH precedes AS_PATH, the deletion causes all subsequent attributes to shift left.\nmsg.PathAttributes = append(msg.PathAttributes[:as4AttrPos], msg.PathAttributes[as4AttrPos+1:]...)\n\n// Line 206: The stale asAttrPos index is used here.\n//The function continues to use the stale index (asAttrPos) to update the AS_PATH. Since the slice length has decreased, accessing the old index leads to a panic.\nmsg.PathAttributes[asAttrPos] = bgp.NewPathAttributeAsPath(newIntfParams)\n```\nThis deletion causes all subsequent attributes in the slice to shift left by one position. However, the function continues to use the original asAttrPos index (calculated before the deletion) to access or modify the AS_PATH attribute later at [Line 206](https://www.google.com/search?q=https://github.com/osrg/gobgp/blob/v4.2.0/internal/pkg/table/message.go%23L206). Because the slice is now shorter, the \"stale\" index points out of bounds, triggering a panic and crashing the entire GoBGP process.\n### PoC\nEnvironment: * GoBGP version: 4.2.0\nConfiguration: Passive peering enabled.\nReproduction Steps:\nConfigure GoBGP with a neighbor (e.g., 192.168.31.195).\nSend a specially crafted BGP UPDATE hex payload:\n```\nff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff\n00 22 02\n00 00                  # Withdrawn Routes Length\n00 0b                  # Total Path Attribute Length\n40 11 01 02            # AS4_PATH (Type 17, Len 1, Val 02) - Triggers the bug\n40 02 04 ff ff de ad   # AS_PATH (Type 2, Len 4)\n```\nThe GoBGP process will immediately crash with: panic: runtime error: index out of range [1] with length 1.\n\n### Impact\nVulnerability Type: Remote Denial of Service (DoS).\nImpacted Users: Any GoBGP deployment (v4.2.0 and earlier) that accepts BGP UPDATE messages from peers. Since this crash occurs in the FSM (Finite State Machine) handling loop, a single malicious peer or a malformed route propagated through a transit provider can consistently crash the BGP daemon, leading to a complete loss of routing capabilities.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/osrg/gobgp/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.2.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/osrg/gobgp/security/advisories/GHSA-8rxh-r2p6-7f2q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41643"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/osrg/gobgp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/osrg/gobgp/releases/tag/v4.3.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-129" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-29T20:44:04Z",
    "nvd_published_at" : "2026-05-07T12:16:17Z"
  }
}