
A fixed stack array of 2048 + 1 positions. A peer-controlled AS_PATH that
can exceed it. A filter mask that makes the matcher walk the path. No fixed
version, and a supplier position that says this is the operator's problem.
What the advisory says
CZ.NIC BIRD Internet Routing Daemon through 2.19.0 contains a
stack-based buffer overflow in the BGP AS_PATH mask matching
implementation innest/a-path.c. Theas_path_match()function uses a
fixed-size stack array of 2048 + 1pm_posentries, whileparse_path()
expands AS_PATH segments from a received BGP UPDATE without enforcing a
corresponding capacity limit. When RFC 8654 BGP Extended Messages are
enabled and a BIRD filter evaluates an AS path mask expression such as
bgp_path ~ [= ... =], an established BGP peer can send a long AS_PATH
containing more than 2048 expanded ASNs. This causes
parse_path()/as_path_match()to write beyond the fixed stack buffer,
resulting in a crash of the daemon.
CVE-2026-49943, GHSA-64c8-8qx9-25r7. Weakness CWE-121 (stack-based
buffer overflow). CVSS 3.1 6.3 MEDIUM:
AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:N/A:H. Affected 0–2.19.0. No fixed
version listed. NVD published 2026-06-02, last modified 2026-07-22.
The mechanism, step by step
- A peer has an established BGP session — at an exchange, membership is the
only requirement. - The peer sends a long AS_PATH. With RFC 8654 extended messages the UPDATE
can be far larger than the historical 4096-byte cap, so more than 2048
expanded ASNs are deliverable. - A BIRD filter evaluates an AS path mask against the route. The mask makes
the matcher align the pattern with the path. parse_path()produces more positions thanas_path_match()can store.as_path_match()writes past the end of thepm_posstack array.- The stack canary aborts the process — or, with an info leak and a capable
attacker, control flow is redirected.
The first outcome is a remote denial of service from any peer. The second is
code execution as the routing daemon.
Why it is the fundamental flaw
Every edge in part 6 is a condition. This one is the contract:
- A fixed bound chosen for the common case. 2048 positions is generous for
real internet paths. The bug is that the code trusts that generosity instead
of enforcing it. - Producer and consumer disagree.
parse_path()can generate more
positions thanas_path_match()can store. Two components with an implicit
contract and no shared constant. - Trusted configuration meets untrusted input. The mask is the operator's;
the path is the peer's. The daemon assumes the first is benign and forgets
the second is not. - No runtime memory safety. BIRD is C. There is no bounds check unless the
code writes one, and no privilege boundary between the parser and the rest of
the daemon.
A route server's job is to accept BGP from hundreds of organisations and apply
policy to what they send. The policy language is the product. The matcher is
where the product touches the most hostile input in the system.
The supplier position
The advisory records the vendor's position plainly: a fix is not being
prioritised because all network operators should already be rejecting routes
with unusually long attributes.
That is a defensible position about operational hygiene. It is not a fix. An
operator who has not written a path-length limit is exposed, and the default
configuration does not write one for them.
What is documented, and what is inferred
Documented: CVE and GHSA identifiers, CWE-121, CVSS 6.3, the affected range
0–2.19.0, the absence of a fixed version, the file and functions
(nest/a-path.c, parse_path(), as_path_match()), the fixed array size
(2048 + 1 pm_pos entries), the role of RFC 8654 extended messages, and the
supplier position.
Inferred: the stack-smashing consequences (canary abort vs control-flow
hijack), and the exact composition of mask and path that exceeds 2048
positions. The advisory describes the producer/consumer gap; it does not
publish the arithmetic.
Unknown: whether a proof of concept exists, whether a distribution shipped
a backport on a pre-2.19 branch, and whether 2.20.0 contains an unannounced
fix. None of those should be assumed.

Next: Part 8 — no fix, no milestone: the version story and what to check
before assuming you are patched.

Comments (0)