Hijacks and leaks
A hijack is a route announced by a network that doesn't hold the addresses. Traffic for them goes to that network instead of to their holder.
A route leak is a real route passed on to networks that should never have received it. Traffic still reaches the holder, but the long way, through a network that can't carry it.
BGP believes what neighbors tell it, so BGP itself stops neither.
Two incidents
A hijack, on February 24, 2008. At 18:47 UTC, Pakistan Telecom, AS17557, began announcing 208.65.153.0/24. YouTube, AS36561, announced 208.65.152.0/22, which includes that /24. The upstream of Pakistan Telecom, PCCW Global, AS3491, passed the /24 on. A /24 is a longer match than a /22, so routers that heard it sent YouTube's traffic for those addresses to Pakistan.
At 20:07 YouTube announced the same /24. This won back only part of the internet, because two routes of equal length compete on path. At 20:18 YouTube announced two /25 routes inside it, longer than anything else, and traffic came back. At 21:01 PCCW withdrew the routes.
A leak, on June 24, 2019. At 10:30 UTC, DQE Communications, AS33154, was running a Software that splits a network's routes into smaller, more specific ones to steer its own traffic. The more specific routes are meant to stay inside that network.. It had split routes it learned into more specific ones, for use inside its own network. They reached its customer Allegheny Technologies, AS396531. Allegheny passed them to its other provider, Verizon, AS701, which passed them on to the internet.
The routes were more specific, so much of the internet sent traffic for the affected networks through DQE, Allegheny, and Verizon, which weren't built for it. Cloudflare saw about 15% of its global traffic lost at the worst point. Many sites couldn't be reached from large parts of the internet. Cloudflare's ROAs allowed nothing longer than /20, so the more specific routes made from its space were RPKI invalid. A network that dropped invalid routes would have refused them.
| Hijack | Route leak | |
|---|---|---|
| The route | Announced by a network that doesn't hold the space | A real route, passed on beyond where it was meant to go |
| The origin AS | Wrong, or forged to look right | Right |
| Where traffic goes | To the hijacker | To the holder, through the leaking network |
| What stops it | Origin validation, registry filters | Registry filters, roles, max_prefixes |
Route origin validation
You met RPKI, the Resource Public Key Infrastructure, and its three answers in Route policies. Here is where they come from:
- You publish a ROA. A Route Origin Authorization: a signed record that says which AS may announce a prefix, and how specific the prefixes it announces inside it may be, such as up to /24. says that this prefix, up to this length, may be originated by this AS. You create it with your Regional internet registry: one of five organizations that hand out addresses and AS numbers for a part of the world. APNIC is the one for Asia and the Pacific., the registry that gave you the space. At APNIC, you do it in the MyAPNIC portal.
- Validators collect them. A A program that downloads every ROA from the registries, checks each signature, and gives routers the list of valid ones. downloads every ROA and checks its signature. It serves the result to routers over the RPKI to Router protocol, RTR. Routinator is one such program.
- Routers check every route. For each route, the router compares the prefix and the The AS that first announced a prefix: the network the addresses belong to. It is the last AS in the AS path. with the ROAs. It marks the route valid, invalid, or not found.
- Your policy acts on it.
presets.bgp_sanityrejects invalid routes. Valid and not found ones go on through the rest of the import.
RFC 6811 defines the check with two words. A ROA covers a route when the route's prefix is the prefix of the ROA, or inside it. A ROA matches a route when it covers it, has the same origin AS, and allows its length. Then:
- Not found means no ROA covers the route.
- Valid means at least one ROA matches it.
- Invalid means at least one ROA covers it, and none matches.
Load each case and read which ROAs cover the route, and which match. Then change a maxLength or the origin yourself, and predict the answer before you look.
What the validator holds
The route your router receives
The origin is the last AS in the path: AS64500.
| ROA | Covers the prefix? | Names AS64500? | /40 within maxLength? |
|---|---|---|---|
| 2001:db8:a00::/40, max /40, AS64500 | yes | yes | yes |
2001:db8:a00::/40 from AS64500 is valid: the ROA for 2001:db8:a00::/40 has AS64500 as the origin and allows up to /40. presets.bgp_sanity lets it on to the rest of the import.
Two things are easy to miss:
- A route can be invalid for its length alone. The "A /48 of yours" case comes from your own AS. But your ROA allows only a /40, so the /48 is invalid.
maxLengthis a promise to everyone. A ROA that allows every /48 inside your /40 makes any of them valid from your AS, even ones you never announce. A hijacker who writes your AS at the end of the path then passes the check. This is a forged origin, as in the "Forged origin" case.
So RFC 9319 asks for minimal ROAs. List the prefixes you really announce, and avoid maxLength.
Watching a hijack die out
Here your network, AS64500, has 2001:db8:a00::/40. AS64510 is another customer of your provider, and also of the east transit. In the widget, each network prefers routes from its customers, then from its peers, then from its providers, then the shorter path. On a tie, it takes the route from the lower AS number.
AS64510 starts by announcing your /40. See which networks now send your traffic to it. Then publish a ROA, and turn on origin validation network by network until every network reaches you. Then try the other things AS64510 can do, and the registry filters.
AS64510 announces 2001:db8:a00::/40 as its own, beside you.
3 of 5 networks reach you directly, 2 send your traffic to AS64510.
| Network | Route it uses for 2001:db8:a00::10 | Traffic goes |
|---|---|---|
| West transit | 2001:db8:a00::/40, path 64501 64500 | To you |
| East transit | 2001:db8:a00::/40, path 64510 | To AS64510 |
| Your provider | 2001:db8:a00::/40, path 64500 | To you |
| East ISP | 2001:db8:a00::/40, path 64497 64510 | To AS64510 |
| West ISP | 2001:db8:a00::/40, path 64496 64501 64500 | To you |
Dropped by a defense
None.
What you saw is how the internet behaves:
- An equal hijack wins part of the internet, the networks closer to the hijacker by preference or path. A more specific hijack wins all of it, because the longest match beats every preference, as it did for YouTube.
- Without your ROA, nothing is invalid. Every network can validate, and your route is still not found. Your ROA is what makes other networks' validation protect you.
- Validation at one network isn't enough. Against the /48, with only the east transit validating, the east transit refused the route. But its traffic still went to the west transit, which had accepted the /48, and so ended at AS64510. Against the /40, with only the east ISP validating, it dropped the one route the east transit offered. It was left with no route at all.
- A leak of your real route beats validation, because the route keeps your origin and your length. The 2019 leak was different: the optimizer had made new, more specific routes, which tight ROAs make invalid.
Registry filters
An Internet Routing Registry: databases where networks publish which AS announces each prefix, in route objects, and which ASes they announce, in AS-SETs. has two kinds of record that matter here:
- A An IRR record that pairs a prefix with the AS that announces it. pairs a prefix with its origin AS.
- An A named list of AS numbers in an IRR, such as a network and its customers, AS64500:AS-CUSTOMERS. lists the ASes a network announces: the network itself and its customers.
A provider builds each customer's import filter from them. A tool such as bgpq4 expands the customer's AS-SET into every route object behind it, and the filter accepts only those prefixes. A leak or a hijack from a filtered customer then stops at the first provider. That is why you register your customers before you announce them: your upstreams filter you the same way.
Two more guards stop leaks, both from Route policies:
roleon each neighbor turns on RFC 9234, so both sides refuse a route that should only flow toward customers. Of the platforms with BGP, onlyrouteroshas roles.max_prefixescloses a session that suddenly sends far more routes than it should, as in 2019.
In Circuit
The validators go in routing.rpki, and presets.bgp_sanity rejects what they mark invalid. A customer's import accepts only its registered space, written in prefix_sets:
routing: {
rpki: [
{ address: "10.0.0.80", port: 323 },
{ address: "10.0.0.81", port: 8282 },
],
// bgp: as before, with role and max_prefixes on every neighbor
prefix_sets: {
// Netflix's space, checked against its route objects and ROAs before it is written here.
"netflix-v4": { prefixes: ["192.0.2.0/24"] },
"netflix-v6": { prefixes: ["2001:db8:200::/48"] },
},
policies: {
sanity: presets.bgp_sanity,
"netflix-import": [
{ call: "sanity" },
{ description: "Their IPv4", if: { prefix_set: "netflix-v4" }, then: "accept" },
{ description: "Their IPv6", if: { prefix_set: "netflix-v6" }, then: "accept" },
{ description: "Nothing else", then: "reject" },
],
},
},Run two validators, so a router still has answers while one is down. A rule of your own can also match rpki: "valid", "invalid", or "not-found".
Circuit doesn't do three things:
- It doesn't publish your ROAs. You create them at your RIR.
- It doesn't read the IRR. You check each customer's route objects and ROAs, then write its prefixes yourself.
- It runs RPKI on
routerosandjunosonly.fortiosruns BGP without RPKI. So it refusesrouting.rpkiand any rule that matchesrpki, including the last rule ofpresets.bgp_sanity. Platforms has the details.
Norms for routing security
Mutually Agreed Norms for Routing Security: a global initiative that asks networks to take a short list of actions against hijacks, leaks, and spoofing., Mutually Agreed Norms for Routing Security, is a global initiative supported by the Global Cyber Alliance. It asks network operators for four actions:- Filtering. Make sure your own announcements and your customers' are correct, with registry filters.
- Anti-spoofing. Check the source address of your customers' traffic, as in Attacks on the network.
- Coordination. Keep your contact details in the routing databases current, so another network can reach you during an incident.
- Global information. Publish your routing data, in the IRR and as ROAs, so others can validate it.
A network that joins commits to all four.
Further reading
- YouTube Hijacking: A RIPE NCC RIS case study, on the 2008 hijack, minute by minute.
- How Verizon and a BGP Optimizer Knocked Large Parts of the Internet Offline Today, the Cloudflare write-up of the 2019 leak.
- RFC 7908, on the kinds of BGP route leaks.
- RFC 6811, BGP prefix origin validation: covered, matched, and the three states.
- RFC 9319, on
maxLengthin the RPKI: minimal ROAs and forged origins. - RFC 9582, the profile for route origin authorizations.
- RFC 9234, on preventing route leaks with roles.
- APNIC RPKI, on creating ROAs in MyAPNIC.
- Routinator, a validator.
- bgpq4, which builds prefix filters from the IRR.
- RIPEstat announced-prefixes, the data behind
ripe-statprefix sets. - MANRS for network operators and its implementation guide.