The Daemon That Speaks in Filters

Site Admin · 3 Dec 2026 · Routing & Protocols

BIRD is a routing daemon in C: small, fast, and expressive enough to run internet exchanges. This series is about a fixed stack array in its AS_PATH mask matcher, and a message size the protocol no longer caps. CVE-2026-49943, no fixed version.

BIRD is a routing daemon written in C, small enough to run anywhere and
expressive enough to run an internet exchange. This series is about a fixed
stack buffer in its AS_PATH matcher — and a message size the protocol no
longer caps.

What it is

BIRD — the Bird Internet Routing Daemon — is an open-source routing daemon for
Linux and BSD, developed at CZ.NIC. It speaks BGP, OSPF, RIP and Babel, keeps a
routing table, and applies policy through a filter language that network
engineers actually like.

The design is deliberately compact. One daemon, a small C codebase, a
configuration language with real expressions, and a filter engine that can
match on attributes rather than just sequences of if statements. It is the
kind of software that fits on a router, in a container, or on a route server
at an exchange.

A plain-language analogy

Think of a BIRD filter as a customs officer with a checklist. Every route
arriving from a peer goes past the officer, who reads the route's paperwork —
its AS path, communities, next hop — and decides whether it enters the country.

The checklist is written in a small language. One of its most useful
expressions is the AS path mask: "accept any path ending in AS64500" or
"match this sequence anywhere in the path". To evaluate it, BIRD lines the
pattern up against the path and records where each element matches.

That alignment is the subject of this series. The officer's notebook has a
fixed number of pages, and the path is written by the visitor.

One tiny example

A filter that accepts routes originated by a customer and rejects the rest:

filter customer_in {
  if (bgp_path.last = 64500) then accept;
  reject;
}

A mask expression is more expressive:

if (bgp_path ~ [= * 64500 =]) then accept;

The second form makes BIRD walk the AS_PATH and record match positions. The
matcher stores those positions in a fixed-size array. The array is the bug.

Why it is in the corpus

The corpus scores CVE-2026-49943 at 4.81 — rank 26 of 26, product
coverage C=2, uncovered 1.60, category SEC. It is the lowest impact score
in the set — and the most serious bug class in it.

The advisory:

CZ.NIC BIRD Internet Routing Daemon through 2.19.0 contains a stack-based
buffer overflow in the BGP AS_PATH mask matching implementation in
nest/a-path.c. The as_path_match() function uses a fixed-size stack array
of 2048 + 1 pm_pos entries, while parse_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, an established BGP peer can send a long AS_PATH
containing more than 2048 expanded ASNs.

A stack buffer overflow in the process that speaks BGP to untrusted peers is a
remote crash at minimum and a potential code-execution primitive at worst.

The correction to the corpus

The corpus file labels this PATCHED 2.19.0+. That is wrong. Verified
against NVD on 2026-11-30:

The series therefore treats the bug as OPEN, no fix, and the remediation
ladder is about bounding the path and hardening the build — not about a version
to upgrade to.

The shape of the series

Part 2 places BIRD at the exchange. Part 3 walks what it does. Part 4 compares
it honestly with FRR, OpenBGPD and GoBGP. Part 5 opens the AS_PATH matcher.
Part 6 marks the smaller failures and protocol edges around it. Part 7 takes
CVE-2026-49943 apart, including the RFC 8654 detail that makes it remotely
reachable. Part 8 is the version story — no fix, no milestone. Part 9 walks the
chain from a peer session to a dead route server. Part 10 is the ladder.

Next: Part 2 — the route server at the exchange: hundreds of members, one
daemon, and a shared fate.