The Way Out: Bound the Path, Harden the Stack

Site Admin · 3 Dec 2026 · Routing & Protocols

There is no patch. Bound the path in import policy, keep -fstack-protector-strong, restrict the peer population, monitor for the crash, or run a different daemon. The operator's bound is the fix.

There is no fixed version to install. The ladder is the operator's: reject
long paths, keep the stack protector, restrict who can peer, and know when to
run a different daemon.

The ladder

Rung Action What it buys
1 Reject long AS_PATHs in import policy Removes the input the matcher cannot handle
2 Confirm -fstack-protector-strong Converts a potential RCE into a crash
3 Restrict the peer population / GTSM Narrows who can send the trigger
4 Monitor for absence and simultaneous session loss Detects a crash in minutes
5 Replace with FRR, OpenBGPD or GoBGP A different memory-safety posture

Rung 1 is the mitigation the supplier points at. It is also the only one that
prevents the overflow rather than surviving it.

Rung 1: bound the path

BIRD's filter language exposes the path length, so an import policy can reject
pathological paths before the mask matcher sees them:

filter member_in {
  if (bgp_path.len > 64) then reject;   # or your operational maximum
  if (bgp_path ~ [= * 64500 =]) then accept;
  reject;
}

What it changes: the matcher only ever evaluates paths whose length is within
the operator's bound. A path with thousands of ASNs is rejected by a cheap
integer comparison, not by an alignment walk.

What it costs: nothing for legitimate routes — real internet paths are tens of
ASNs — and it is standard hygiene regardless of this CVE.

The exact maximum is a policy decision. Pick one that fits your table and
enforce it on every eBGP session, not just members.

Rung 2: keep the canary

Check the build:

readelf -s /usr/sbin/bird | grep __stack_chk_fail

If the symbol is present, the binary has stack protection and a crude overflow
becomes an abort rather than a control-flow hijack. Most distribution builds
enable it; custom builds and embedded images may not.

This does not prevent the crash. It prevents the worse outcome and produces a
log line that tells you what happened.

Rung 3: narrow the peer population

At an exchange, membership is the risk surface. There is no middlebox that
filters AS_PATH semantics; membership policy and monitoring are the controls.

Rung 4: monitor for the crash

Rung 5: replace the daemon

If the requirement is a route server and the risk posture does not accept an
unfixed stack overflow:

None of these is automatically safer. Each is a different set of trade-offs,
and each must be evaluated against the same input: hundreds of members sending
paths you do not control.

The residual risk

With a path-length bound and a stack canary:

Without them, one peer with an extended message and a mask in the policy path
can end the daemon. The bug has no vendor fix; the operator's bound is the fix.

The bottom line

A fixed stack array is a promise that the input will stay small. BGP no longer
makes that promise — extended messages removed the ceiling — and a route server
accepts input from everyone. The honest remediation is to restore the bound in
policy, keep the canary in the build, and stop treating "the vendor should fix
it" as a plan.

Next: the corpus queue continues — see the series index for what follows.