Skip to main content

bgpq4 EUVDEUVD-2026-137525

| CVE-2026-138151 HIGH
Integer Overflow or Wraparound (CWE-190)
2026-11-28 VulnCheck GHSA-c68x-j5fv-6w36
8.2
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Control queried IRR server or MITM plaintext TCP
  2. Exploit
    Send crafted A<len> reply announcing ULONG_MAX or -1
  3. Execution
    Integer overflow wraps malloc(togot+2) to one byte
  4. Impact
    Heap buffer overflow crashes bgpq4

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Integer overflow checks
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the attacker to control the IRR/IRRd server that bgpq4 queries, or to be able to tamper with the plaintext (unencrypted whois/IRRd) TCP connection to a legitimate mirror, and to return a crafted 'A<len>' reply announcing a length of ULONG_MAX or -1 so that malloc(togot + 2) wraps to a one-byte allocation. Limiting factors: the attacker needs either server control or an in-path MITM position, reflected in AC:H and AT:P, which makes opportunistic exploitation hard; no authentication is required against bgpq4 itself (PR:N) and no user interaction is needed (UI:N). Impact is bounded to a denial of service / crash of the bgpq4 client per the CVSS vector (VA:H only); affected versions are bgpq4 before 1.17, fixed in 1.17.

Impact

The signals are internally consistent and point to a real but position-gated availability issue rather than a broadly wormable one. The CVSS 4.0 vector (AV:N/AC:H/AT:P/PR:N/UI:N) describes a network-reachable flaw that nonetheless carries both high attack complexity and a specific Attack Requirement (AT:P): the attacker must either operate the IRR/IRRd server bgpq4 queries or tamper with the plaintext TCP connection to it, which demands a privileged network position (MITM) or control of a queried mirror. Impact is confined to availability (VA:H; VC:N/VI:N), so despite the 'heap memory corruption' wording in the description, every scored metric and the 'Denial Of Service' tag treat the outcome as a crash, not code execution - the description implies potential memory corruption but CVSS maps only to DoS; this tension should be verified against the VulnCheck advisory before assuming exploitability beyond a crash. No EPSS score, no CISA KEV listing, and no public exploit were supplied, so there is no evidence of active or at-scale exploitation; the vuln.today Decision label is 'this_week', i.e. a prompt-but-not-emergency priority. Net: a legitimately high CVSS (8.2) driven by network reach and full availability loss, but the AC:H/AT:P gating and DoS-only impact place it below drop-everything urgency for most operators.

Exploit ScenarioDerived

An attacker who runs a malicious IRR server, or who can intercept the unencrypted TCP connection between bgpq4 and a legitimate IRR mirror, returns a crafted 'A<len>' reply announcing a length of ULONG_MAX or -1. bgpq4 computes malloc(togot + 2), which integer-overflows and wraps to a one-byte allocation, producing heap corruption and crashing the process. Given AC:H and AT:P, this requires the attacker to already control the response path; no public exploit identified at time of analysis.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 28, 2026

Integer overflow in bgpq4 before 1.17 lets an attacker who controls the IRR/IRRd server being queried - or who can tamper with the plaintext whois/IRRd TCP connection to a legitimate mirror - crash the client. A crafted 'A<len>' reply announcing ULONG_MAX or -1 makes malloc(togot + 2) wrap to a one-byte allocation, so the subsequent read corrupts heap memory and terminates bgpq4. No public exploit code was identified at time of analysis, but exploitation is unauthenticated (PR:N, UI:N) and is gated by the attacker's position (AC:H, AT:P); impact is availability only (VA:H), and a vendor fix exists in 1.17.

RemediationAI

Vendor-released patch: upgrade bgpq4 to version 1.17, which caps IRRd A-code reply lengths at BGPQ_MAX_REPLY_LEN (256 MB), adds errno checking around strtoul, and exits on invalid or oversized lengths in both the bgpq_read and bgpq_expand_irrd handlers. The fix is carried in https://github.com/bgp/bgpq4/pull/141 and commits https://github.com/bgp/bgpq4/commit/a232916868d1422edfc7fd5e0a00edd02c80c79a and https://github.com/bgp/bgpq4/commit/37a3adb76f18a800efa6bb02848fbfd6458512e5, with the release at https://github.com/bgp/bgpq4/releases/tag/1.17 and change notes at https://github.com/bgp/bgpq4/blob/1.17/CHANGES; the upstream advisory is https://www.vulncheck.com/advisories/bgpq4-before-1.17-heap-buffer-overflow-via-irrd-a-len-reply-handling. Where upgrading cannot be done immediately, reduce exposure by pointing bgpq4 only at IRR mirrors and network paths you control or trust, since the flaw requires operating the queried server or tampering with the plaintext connection in transit - note this narrows the attack surface but does not remove the underlying unchecked allocation, so it is not a complete substitute for the 1.17 upgrade.

Affected VersionsENISA

bgpq4 0 <1.17

Affected Packages

euvd bgpq4 fix: 1.17

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

bgpq4 is a C utility that expands BGP AS-SET, prefix-list and route-set objects by speaking the IRRd/whois protocol, which runs over plaintext TCP. In expander.c, the A-code reply handler parses the announced length from the response with strtoul(response + 1, &eon, 10) and passes it directly to malloc(togot + 2); both that computation and the int offset used while reading the reply can overflow. This is CWE-190: the length is attacker-controlled and unbounded, so a value of ULONG_MAX or -1 causes the size arithmetic to wrap to a one-byte buffer, and the following read of the announced payload corrupts the heap and crashes the process. The upstream fix to 1.17 (PR #141, commits a232916868d1422edfc7fd5e0a00edd02c80c79a and 37a3adb76f18a800efa6bb02848fbfd6458512e5) checks errno, caps lengths at BGPQ_MAX_REPLY_LEN (256 MB) in both the bgpq_read and bgpq_expand_irrd code paths, and rejects anything larger with an error and exit. The affected code regions are visible in the 1.16 source at expander.c#L722-L771 and #L918-L958. The vulnerability requires the attacker to influence the server side of the query - either by operating the IRR server or by sitting in-path on the unencrypted connection - which is why the assessed vector reflects AC:H and AT:P despite the PR:N, UI:N availability impact.

Know when Bgpq4 gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (VulnCheck) PRIMARY 8.2 HIGH
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 5.9 MEDIUM

Attacker must control or MITM the IRR server reply (AC:H, no auth on bgpq4 so PR:N); impact is a client crash only, so C:N/I:N and A:H.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

bgpq4 before 1.17 contains an integer overflow vulnerability in expander.c that allows malicious IRR servers to corrupt heap memory by sending crafted A<len> replies. Attackers controlling the IRR server or tampering with the plaintext TCP connection can announce a ULONG_MAX or -1 length, wrapping the allocation to one byte and crashing bgpq4.

Executive ViewAI

Why It Matters

CVE-2026-138151 is a high-severity integer overflow in bgpq4 (versions before 1.17) that can crash the tool when it queries a malicious or tampered IRR server. This affects network operations teams who rely on bgpq4 for route filtering; a crash could disrupt BGP prefix-list generation and potentially impact network stability. Leadership should prioritize patching because the vulnerability is remotely exploitable without authentication, though it requires network position and currently has no known public exploit.

Business Impact: High
Compensating Controls

Apply vendor patch (upgrade to bgpq4 1.17). Until patched, restrict bgpq4 to query only trusted IRR servers over secured channels (TLS/IPsec) and monitor for crashes.

Threat Intelligence Overview

EPSS Score
0.6%
Top 60% exploitable
Prevalence
Low
niche network-operator CLI tool for generating BGP/IRR filters
Social Media
2
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +41
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Integer overflow occurs when an arithmetic operation produces a result that exceeds the maximum value a given integer type can store.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

Debian

bgpq4
Release Status Fixed Version Urgency
bookworm vulnerable 1.9-1 -
trixie vulnerable 1.12-1 -
forky, sid vulnerable 1.16-1 -
(unstable) fixed (unfixed) -

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy