{"id":"CVE-2026-49837","aliases":["CVE-2026-49837","GHSA-gjrg-jjr3-56cm","GO-2026-5955"],"related":[],"kind":"vulnerability","state":"published","title":"GoBGP: BGP OPEN capability parser may read capability values outside declared CapLen boundaries","summary":"GoBGP is an open source Border Gateway Protocol (BGP) implementation in the Go Programming Language. Versions prior to 4.6.0 contain 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. Version 4.6.0 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"GoBGP is an open source Border Gateway Protocol (BGP) implementation in the Go Programming Language. Versions prior to 4.6.0 contain 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. Version 4.6.0 patches the issue.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"GoBGP: BGP OPEN capability parser may read capability values outside declared CapLen boundaries in github.com/osrg/gobgp","format":"markdown","source":"go"}],"published":"2026-07-09T23:20:57.000Z","modified":"2026-09-16T13:42:46.953Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"version":"< 4.6.0","status":"affected"}],"vendor":"osrg","product":"gobgp","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.6.0"}],"ecosystem":"Go","package":"github.com/osrg/gobgp/v4","purl":"pkg:golang/github.com/osrg/gobgp/v4","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"4.6.0"}],"ecosystem":"Go","package":"github.com/osrg/gobgp/v4","purl":"pkg:golang/github.com/osrg/gobgp/v4","source":"go"}],"references":[{"url":"https://github.com/osrg/gobgp/security/advisories/GHSA-gjrg-jjr3-56cm","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/osrg/gobgp/commit/f02ca397821f6ca182ef4eb492c3cbc459552d7c","tags":["fix","x-refsource-misc"],"sources":["cvelist","go","nvd"]},{"url":"https://github.com/osrg/gobgp","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-09-15T15:10:05.962Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49837","url":"https://www.cve.org/CVERecord?id=CVE-2026-49837","licence":"CVE Terms of Use","modified":"2026-09-15T15:10:15.877Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gjrg-jjr3-56cm","url":"https://github.com/advisories/GHSA-gjrg-jjr3-56cm","licence":"CC-BY-4.0","modified":"2026-07-24T19:11:27.019Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5955","url":"https://pkg.go.dev/vuln/GO-2026-5955","licence":"CC-BY-4.0","modified":"2026-07-24T19:00:27.270Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49837","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49837","licence":"Public domain","modified":"2026-09-16T13:42:46.953Z"}],"updatedAt":"2026-11-25T22:59:37.908Z","epss":{"score":0.00255,"percentile":0.18269,"date":"2026-12-01T12:00:22.000Z"}}