Skip to content

ProfessionalLesson 9 of 14

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.

HijackRoute leak
The routeAnnounced by a network that doesn't hold the spaceA real route, passed on beyond where it was meant to go
The origin ASWrong, or forged to look rightRight
Where traffic goesTo the hijackerTo the holder, through the leaking network
What stops itOrigin validation, registry filtersRegistry filters, roles, max_prefixes
CheckA network learns your prefix from its provider, and announces it to its other provider. The AS path still ends in your AS. Which is it?

Route origin validation ​

You met RPKI, the Resource Public Key Infrastructure, and its three answers in Route policies. Here is where they come from:

  1. 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.
  2. 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.
  3. 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.
  4. Your policy acts on it. presets.bgp_sanity rejects 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.
Try itDecide valid, invalid, or not found

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.

Load a case

What the validator holds

The route your router receives

The origin is the last AS in the path: AS64500.

ROACovers the prefix?Names AS64500?/40 within maxLength?
2001:db8:a00::/40, max /40, AS64500yesyesyes

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.
  • maxLength is 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.

CheckYour ROA is 2001:db8:a00::/40, maxLength 40, AS64500. A route for 2001:db8:a00::/44 arrives from AS64500. What is it?

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.

Try itHijack your block, then stop it

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.

1. What AS64510 does
2. Your ROA
3. Networks that drop RPKI invalid routes
4. Registry filters

AS64510 announces 2001:db8:a00::/40 as its own, beside you.

peersWest transitAS64496East transitAS64497Your providerAS64501East ISPAS64502West ISPAS64503YouAS64500Another networkAS64510To youTo AS64510To youTo AS64510To you

3 of 5 networks reach you directly, 2 send your traffic to AS64510.

NetworkRoute it uses for 2001:db8:a00::10Traffic goes
West transit2001:db8:a00::/40, path 64501 64500To you
East transit2001:db8:a00::/40, path 64510To AS64510
Your provider2001:db8:a00::/40, path 64500To you
East ISP2001:db8:a00::/40, path 64497 64510To AS64510
West ISP2001:db8:a00::/40, path 64496 64501 64500To 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.
CheckAS64510 leaks your route to the east transit. Every network drops RPKI invalid routes, and your ROA is right. Why does the leak still spread?

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:

  • role on each neighbor turns on RFC 9234, so both sides refuse a route that should only flow toward customers. Of the platforms with BGP, only routeros has roles.
  • max_prefixes closes 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:

ts
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 routeros and junos only. fortios runs BGP without RPKI. So it refuses routing.rpki and any rule that matches rpki, including the last rule of presets.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:
  1. Filtering. Make sure your own announcements and your customers' are correct, with registry filters.
  2. Anti-spoofing. Check the source address of your customers' traffic, as in Attacks on the network.
  3. Coordination. Keep your contact details in the routing databases current, so another network can reach you during an incident.
  4. 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 ​

Discussion

Stuck, or found a mistake? Ask here. You sign in with GitHub.

Released under the Business Source License 1.1.