Packet Path/

BGP Route Leak Explained: The Right Prefix on the Wrong Path

A route leak is not a stolen prefix. The prefix is real, the origin is usually the real owner — what is wrong is the path. RFC 7908 defines a leak as a routing announcement propagated beyond its intended scope: a network passes a route it learned from one provider or peer on to another provider or peer, breaking the valley-free rule that traffic should go up to a provider, across at most one peer link, then down to customers — never back up again. The leaking network accidentally becomes a transit network it was never meant to be, traffic floods through it, and distant sites slow down or drop off. This guide separates leaks from hijacks, shows the checks that tell them apart, and covers the defenses, including RFC 9234 BGP Roles and the Only-to-Customer attribute.

Routing · Intermediate · 10 min · November 22, 2026

Editorial illustration on a dark teal background: a glowing packet travelling up a hill of network routers, across a single peak, then leaking sideways down a wrong valley path toward a second provider tower, with an orange warning marker on the sideways turn.

The short answer

What is a BGP route leak? It is a correct route sent to the wrong audience. BGP (the Border Gateway Protocol — the system networks use to tell each other which IP address blocks, called prefixes, they can reach) runs on business relationships: providers sell transit (carriage to the whole Internet), peers swap their own customers' routes for free, and customers announce only their own prefixes. A leak happens when a network breaks that deal — most often by taking routes it learned from one provider or peer and announcing them onward to another provider or peer, as if it were a transit provider itself. The standards document RFC 7908 defines it in one line: a route leak is the propagation of routing announcements beyond their intended scope.

In plain English

Think of a courier depot that is only supposed to deliver its own town's parcels. One morning a mislabelled cage arrives from the national carrier, and the depot — following its normal routine — forwards those parcels to a rival national carrier as if they were its own. Nothing was stolen and no label was forged: the parcels are real, and they even carry the right return address. The mistake is that this depot was never a national hub. Within hours, half the country's parcels are being routed through a building with two vans. That is a route leak: a small or mid-sized network accidentally offering itself as a shortcut across the Internet, and the Internet — which loves a shortcut — taking it up on the offer until it falls over.

Leak or hijack? The difference that decides the fix

These two get mixed up constantly, and the mix-up matters because the defenses are different. In a BGP hijack, a network announces a prefix it does not own — the origin is wrong. In a leak, the origin is normally right: the prefix belongs to exactly who the announcement says it belongs to. What is wrong is who is passing it along, and to whom. A useful one-line test: a hijack lies about where a route starts; a leak lies — usually by accident — about where a route is allowed to go.

That difference is why RPKI (the Resource Public Key Infrastructure — the system that lets a prefix owner publish a signed statement, a ROA, of which network may originate it) does not stop a classic leak. Origin validation checks the first network in the path against the ROA. In a leak that first network is the genuine owner, so the check passes with a green tick while the route travels somewhere it never should. RPKI is still essential — it is the main defense against hijacks, as RPKI Explained covers — but a leak needs defenses that look at the path, not just the origin. Keep both in the toolbox and never expect one to do the other's job.

Valley-free (healthy) vs a leak (down, then back up)CustomerProviderPeerCustomerUp, across once,then down. Allowed.Leaking networkDown, then UP againto a 2nd provider = leak

In plain English: a healthy path climbs a hill, crosses the top once at most, and comes down the other side. A leaked path comes down into a valley and then climbs a second hill — that second climb is the leak.

The valley-free rule, in plain words

Internet paths have a shape, and the shape comes from money. A customer pays a provider, so traffic may climb up from customers to providers for free. Two providers may swap traffic across a peer link at the top. After that, traffic only travels down toward customers — because nobody below the top is being paid to carry strangers' traffic uphill again. A path that goes up, optionally across, then down is called valley-free. A path that goes down and then up again has a valley in it, and a valley means some network in the middle is carrying transit it never sold — the signature of a leak.

RFC 7908 sorts documented leaks into six types. You do not need the numbers memorised; the patterns underneath them are what you will actually meet. Types 1 to 4 are the same sin in different company: a route learned from a provider or peer is passed to another provider or peer (a hairpin turn back to the same provider, a sideways ISP-to-ISP-to-ISP pass, provider routes leaked to a peer, peer routes leaked to a provider). Type 5 is a network re-originating someone else's prefix as its own while still forwarding the traffic onward — the one type that blurs into hijack territory. Type 6 is a network leaking its own internal or more-specific prefixes that were never meant to leave the building. When you read an incident report, ask one question — who handed the route to someone outside its intended scope? — and you have classified it well enough to fix it.

What a leak actually does

Why does one wrong announcement matter? Because BGP prefers short paths, and a leak often invents a shorter-looking one. Thousands of networks recalculate, decide the leaking network is now a fine way to reach whole regions, and pour traffic into it. Three things follow, in roughly this order. First, the leaking network drowns: links and routers sized for its own customers suddenly carry transit for strangers, queues fill, and its own customers fall off the Internet — the leaker is usually the first victim. Second, everyone whose traffic took the shortcut sees latency jump or connections break, especially where the path in or out of the leaker is asymmetric (traffic goes one way through the leak and tries to return another way, and stateful firewalls drop what they never saw start). Third, the damage is oddly selective: only prefixes that were leaked, and only sources whose best path changed, are affected — which is why leak reports read as 'half the Internet is slow from some places' rather than a clean outage.

The checks: telling a leak from a hijack in the first ten minutes

Work these in order; each one rules something in or out. 1. Check the origin. Look the affected prefix up in a looking glass or the free toolkit linked below. If the origin AS (the first network in the path, read right-to-left at the end of the AS path) is not the prefix's owner, you are in hijack or mis-origination territory — follow the hijack guide. If the origin is the true owner, keep going. 2. Read the middle of the path. Find where the path breaks valley-free shape: a small network sitting between two large providers, or a peer appearing where only a customer cone should be. That middle network is almost always your leaker. 3. Check RPKI — and expect it to pass. A valid ROA result on a broken path is itself evidence for a leak rather than a hijack; do not let a green RPKI result talk you out of a path that is visibly wrong. 4. Ask 'is this new, and is it everywhere?' Leaks typically appear suddenly, propagate very widely (the false shortcut is attractive), and often vanish within hours when the leaker's sessions are shut or filtered. A change visible from only one vantage point is more likely ordinary traffic engineering. 5. If the leaker is you — and be honest, it is often the network that just turned up a new session — check your export policies on every external session before you check anything else.

RFC 9234: the OTC stamp at the peak of the pathRoute climbing upNo OTC yetPeak: OTC stampedwith the peak AS numberDown to customersAllowed — keep OTCAfter the stamp: announcing the route UP to a provider or ACROSS to a peer is a leak —a router that sees OTC arrive from a customer or peer session treats the route as leaked.OTC is attribute type 35, set once, and must be preserved unchanged onward.

In plain English: once a route has reached the top of the hill, it gets a stamp saying so. After that it may only be handed downhill to customers — anyone trying to pass a stamped route back uphill exposes the leak automatically.

The defenses, in the order to build them

Export filtering first, because it stops the leak at the only place it can start. The rule fits on an index card: to peers and providers, announce only your own prefixes and your customers' prefixes — never routes you learned from another peer or provider. Build it deny-by-default: an export policy that permits an explicit customer-cone list (built from IRR route objects, the Internet Routing Registry's public records of who may announce what) and drops everything else. The classic leak — a brand-new peering session with no export filter — becomes impossible instead of merely unlikely. Import defenses second: max-prefix limits on every session (a peer that normally sends you a few hundred routes and suddenly sends a full table gets its session dropped before it can leak the world through you), plus IRR-based import filters on customer sessions so a customer can only announce what it has registered. Detection third: monitor your own prefixes from external vantage points and alarm on impossible paths — your prefix showing a valley, or appearing behind a network you have no relationship with. Detection does not prevent the first minutes of someone else's leak, but it is how you learn your network is the leaker while there is still time to fix it quietly.

Then the protocol fix: RFC 9234. Historically, leak prevention depended entirely on every operator hand-configuring those filters correctly, with no way for two neighbours to check they agreed on their relationship. RFC 9234 (May 2022) moves the agreement into BGP itself. Neighbours declare BGP Roles in the OPEN message that starts a session — provider, customer, peer, route server, or route-server client — and the session knows whether the two sides' roles match. Routes are then marked with the Only-to-Customer (OTC) attribute (path attribute type 35): the first time a route stops climbing and is handed to a peer or a customer, it is stamped with that network's AS number, and from then on it may only travel down to customers. If a route carrying OTC arrives from a customer or a peer, it has leaked, and a supporting router can refuse it without any operator-written policy. Deployment is still growing rather than universal — which is exactly why the manual filters above remain the first line, not a legacy chore. ASPA (Autonomous System Provider Authorization, RPKI records of who a network's providers are) is the emerging companion that lets receivers validate the path's shape against signed data; treat it as one to watch and adopt as vendor support lands, not as a substitute today.

If you leak: the honest playbook

It happens to careful networks, and the response is short. Shut or filter the leaking session first — stop the announcement before you diagnose it; every minute of leak is traffic through a network that cannot carry it. Then withdraw, verify from an external looking glass that your paths have returned to valley-free shapes, and only then do the archaeology: which session, which missing filter, which change window. Finally, say so — a short note to the affected peers and, where the leak was wide, a public post-mortem. The community norm is strong here precisely because leaks are accidents: networks that report promptly get help and forgiveness; the filter you add afterwards is the real fix, and it is the same deny-by-default export policy this guide started with. For the foundations underneath all of this — sessions, attributes, and how a route is chosen — BGP Explained is the place to start.

Try it yourself

Take a prefix you care about and run it through the free BGP Toolkit: check its origin and RPKI status, then look at the AS path and read it for shape — up, across at most once, down — and ask whether every network in the middle belongs there. That one habit, origin plus path shape, is the whole leak-versus-hijack test from this guide. To make sure your own routers only announce what they should, compare your BGP configuration against your intended policy with the free Network Config Verifier before the session goes live — the cheapest leak is the one a config check catches first.

Fact-check sources: the definition of a route leak (propagation of routing announcements beyond their intended scope), the valley-free model and the six-type classification (Types 1–4 role violations between providers and peers, Type 5 re-origination, Type 6 internal/more-specific leak) — RFC 7908, Problem Definition and Classification of BGP Route Leaks (June 2016), opened via search result this run. BGP Roles negotiated in the OPEN message, the five roles and their valid pairings, the Only-to-Customer attribute (optional transitive, type code 35, set at the first sideways-or-downward step, preserved unchanged, and a route carrying OTC received from a customer or route-server client is a leak) — RFC 9234, Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages (May 2022), opened via search result this run, with deployment context from Cloudflare's RFC 9234 adoption write-up surfaced in the same results. The claim that RPKI origin validation validates the origin only — and so passes a classic leak whose origin is genuine — follows from the ROA model as covered in the site's own RPKI Explained article.

Related guides

Key takeaways

Keep reading