CVE-2026-49837

CVE-2026-49837 is a medium-severity out-of-bounds read vulnerability in github.com/osrg/gobgp/v4 (go), affecting versions <= 4.5.0. It is fixed in 4.6.0.

Check whether CVE-2026-49837 affects your applications

Kodem tells you whether this CVE is present, reachable, and actually executing in your application, so you know if it matters.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence. Only the CVEs that actually run in production.

Summary

GoBGP: BGP OPEN capability parser may read capability values outside declared CapLen boundaries

Full technical description

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:

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.

Impact

A read operation accesses a memory location beyond the intended buffer boundary. Typical impact: sensitive data disclosure or crash.

CVE-2026-49837 has a CVSS score of 5.9 (Medium). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.6.0); upgrading removes the vulnerable code path.

Affected versions

github.com/osrg/gobgp/v4 (<= 4.5.0)

Security releases

github.com/osrg/gobgp/v4 → 4.6.0 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade github.com/osrg/gobgp/v4 to 4.6.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-49837? CVE-2026-49837 is a medium-severity out-of-bounds read vulnerability in github.com/osrg/gobgp/v4 (go), affecting versions <= 4.5.0. It is fixed in 4.6.0. A read operation accesses a memory location beyond the intended buffer boundary.
  2. How severe is CVE-2026-49837? CVE-2026-49837 has a CVSS score of 5.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/osrg/gobgp/v4 are affected by CVE-2026-49837? github.com/osrg/gobgp/v4 (go) versions <= 4.5.0 is affected.
  4. Is there a fix for CVE-2026-49837? Yes. CVE-2026-49837 is fixed in 4.6.0. Upgrade to this version or later.
  5. Is CVE-2026-49837 exploitable, and should I be worried? Whether CVE-2026-49837 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-49837 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-49837? Upgrade github.com/osrg/gobgp/v4 to 4.6.0 or later.

Other vulnerabilities in github.com/osrg/gobgp/v4

Stop the waste.
Protect your environment with Kodem.