From a Peer Session to a Dead Route Server

Site Admin · 3 Dec 2026 · Routing & Protocols

Seven steps from a member session to a dead route server: extended UPDATE, long path, mask evaluation, stack write, crash — and every member's session dies with the process.

Seven steps: a session, an extended UPDATE, a long path, a mask, a write, a
crash — and every member's session dies with the process.

The chain

1. Be a peer

At an exchange, membership is the bar. A route server is configured to accept
BGP from members; that is its purpose. No spoofing, no credential theft, no
position on the data path is required.

2. Bring the session up

OPEN, KEEPALIVE, Established. The peer behaves normally: correct AS, valid
capabilities, plausible routes.

3. Send a long AS_PATH

With RFC 8654 extended messages, the UPDATE can carry far more than 4096
bytes. More than 2048 expanded ASNs are deliverable in one message.

4. Make the filter evaluate a mask

The route must hit a policy expression that uses an AS path mask —
bgp_path ~ [= ... =]. On a route server, that is the common case: masks are
how operators express "accept paths ending in the member's AS".

5. Overflow the position array

parse_path() expands the segments; as_path_match() records alignment
positions in pm_pos, a fixed stack array of 2048 + 1 entries. The writes run
past the end.

6. The process dies — or is hijacked

With a stack canary, the runtime aborts: *** stack smashing detected ***,
SIGABRT, the daemon exits. Without one, or with an info leak to defeat ASLR,
control flow can be redirected and the daemon becomes the attacker's speaker.

7. Every session dies at once

The route server is the session endpoint for every member. A process death is
not one session dropping; it is all of them, simultaneously. On restart, every
peer reconnects and re-exchanges full tables; rate-limited session setup
stretches the window.

Blast radius

Per instance: the routing daemon and every BGP session it holds. On an exchange
route server that is hundreds of members at once.

For code execution rather than a crash: the exchange's routing table and the
policy logic the daemon implements. A route server that can be told what to
advertise is a traffic-interception platform, and the hijack leaves no crash
to investigate.

Detection

What works:

What is silent: a successful control-flow hijack. There is no crash and no
log line; the daemon continues, advertising what the attacker wants.

What cannot help: a generic IPS. The malformed content is an AS_PATH
attribute; no mainstream IPS parses AS_PATH semantics, and at an exchange the
traffic is legitimate BGP between legitimate members.

Next: Part 10 — the way out: bound the path, harden the stack, and decide
whether the daemon is the right one.