CVE-2026-49837: GoBGP BGP OPEN Capability Parser May Vulnerability

MODERATE
Advisory Identifier: GHSA-gjrg-jjr3-56cm
CVSS 5.9
CWE-125
Published
Advisory Summary

CVE-2026-49837 is a MODERATE (CVSS 5.9) bgp open capability parser may vulnerability (CWE-125: Out-of-bounds Read) affecting GoBGP libraries in the Go ecosystem. The issue involves bgp open capability parser may read capability values outside declared caplen boundaries. Remediation is available by upgrading affected packages to version 4.6.0.

CVE-2026-49837 at a Glance

CVE Identifier CVE-2026-49837
GHSA Identifier GHSA-gjrg-jjr3-56cm
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-125: Out-of-bounds Read
Affected Product GoBGP
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2026-49837

To remediate this vulnerability, upgrade all affected GoBGP 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.6.0
Upgrade github.com/osrg/gobgp/v4 to 4.6.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-49837, inspect your project dependencies for GoBGP:

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

Analyze the terminal output to locate any version of GoBGP in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.6.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-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In GoBGP, 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 GoBGP contains a BGP OPEN capability parsing issue where several concrete capability decoders may parse data from the full remaining capability buffer instead of the slice bounded by the declared capability length, `CapLen`. A malformed BGP OPEN message can cause bytes from a following capability to be interpreted as part of the current capability. The most security-relevant case is the 4-octet AS capability, where a capability with `CapLen == 0` may cause the parser to read bytes from the following capability as the 4-octet AS value. This parsed value may later affect peer AS validation during BGP session establishment. ### Details The issue is in the BGP OPEN capability parser under: - `pkg/packet/bgp/bgp.go` - `pkg/packet/bgp/validate.go` - The BGP OPEN optional parameter capability format includes a capability code, a capability length field, and a capability value. Each concrete capability decoder should only parse bytes inside the declared capability value boundary. In affected versions, the generic capability parser records the declared `CapLen`, but several concrete capability decoders continue parsing from the full remaining capability buffer after advancing past the two-byte capability header. Conceptually, the vulnerable pattern is: ```go data = data[2:] // decoder reads from data without first limiting it to CapLen ### PoC The following parser-level proof of concept demonstrates the issue without requiring a full BGP session or a running `bgpd` instance. The malformed capability uses: - Capability Code: `65` (`BGP_CAP_FOUR_OCTET_AS_NUMBER`) - Declared `CapLen`: `0` - Four following bytes: `00 00 fd e8` Although the capability declares an empty value, affected versions parse the following four bytes as the 4-octet AS value `65000`. ### Impact A remote peer that can send a malformed BGP OPEN message to a GoBGP instance may cause capability values to be parsed from outside their declared `CapLen` boundaries. In the 4-octet AS capability case, this may affect: - peer AS validation; - capability negotiation; - interpretation of malformed OPEN messages; - acceptance or rejection decisions during BGP session establishment. This issue does not appear to be arbitrary memory corruption, remote code execution, or information disclosure. It is a protocol parser boundary validation issue that can affect BGP OPEN validation semantics.

CVE-2026-49837 Affected GoBGP Versions

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

References

Frequently Asked Questions

What is CVE-2026-49837?
CVE-2026-49837 is a security vulnerability in GoBGP involving BGP OPEN capability parser may read capability values outside declared CapLen boundaries under CWE-125: Out-of-bounds Read.
Which GoBGP versions are affected?
Affected versions include releases prior to 4.6.0 across affected packages: github.com/osrg/gobgp/v4.
What version fixes CVE-2026-49837?
Upgrading to 4.6.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.6.0. Upgrade your dependency to 4.6.0 or later.
What is the CVSS score of CVE-2026-49837?
CVE-2026-49837 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-49837?
CVE-2026-49837 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check Go dependencies for CVE-2026-49837?
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-gjrg-jjr3-56cm",
  "modified" : "2026-07-09T23:20:57Z",
  "published" : "2026-07-09T23:20:57Z",
  "aliases" : [ "CVE-2026-49837" ],
  "summary" : "GoBGP: BGP OPEN capability parser may read capability values outside declared CapLen boundaries",
  "details" : "### Summary\n    GoBGP contains a BGP OPEN capability parsing issue where several concrete capability decoders may parse data from the full remaining capability buffer instead of the slice bounded by the declared capability length, `CapLen`.\n    A malformed BGP OPEN message can cause bytes from a following capability to be interpreted as part of the current capability. The most security-relevant case is the 4-octet AS capability, where a capability with `CapLen == 0` may cause the parser to read bytes from the following capability as the 4-octet AS value. This parsed value may later affect peer AS validation during BGP session establishment.\n\n### Details\nThe issue is in the BGP OPEN capability parser under:\n\n- `pkg/packet/bgp/bgp.go`\n- `pkg/packet/bgp/validate.go`\n- \nThe BGP OPEN optional parameter capability format includes a capability code, a capability length field, and a capability value. Each concrete capability decoder should only parse bytes inside the declared capability value boundary.\nIn affected versions, the generic capability parser records the declared `CapLen`, but several concrete capability decoders continue parsing from the full remaining capability buffer after advancing past the two-byte capability header. Conceptually, the vulnerable pattern is:\n```go\ndata = data[2:]\n// decoder reads from data without first limiting it to CapLen\n\n### PoC\nThe following parser-level proof of concept demonstrates the issue without requiring a full BGP session or a running `bgpd` instance.\nThe malformed capability uses:\n- Capability Code: `65` (`BGP_CAP_FOUR_OCTET_AS_NUMBER`)\n- Declared `CapLen`: `0`\n- Four following bytes: `00 00 fd e8`\n\nAlthough the capability declares an empty value, affected versions parse the following four bytes as the 4-octet AS value `65000`.\n\n### Impact\nA remote peer that can send a malformed BGP OPEN message to a GoBGP instance may cause capability values to be parsed from outside their declared `CapLen` boundaries.\nIn the 4-octet AS capability case, this may affect:\n- peer AS validation;\n- capability negotiation;\n- interpretation of malformed OPEN messages;\n- acceptance or rejection decisions during BGP session establishment.\nThis issue does not appear to be arbitrary memory corruption, remote code execution, or information disclosure. It is a protocol parser boundary validation issue that can affect BGP OPEN validation semantics.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/osrg/gobgp/v4"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.6.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.5.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/osrg/gobgp/security/advisories/GHSA-gjrg-jjr3-56cm"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/osrg/gobgp"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-09T23:20:57Z",
    "nvd_published_at" : null
  }
}