IP Addresses & Routing

BGP Hijacks and Route Leaks

See how false or misdirected route announcements pull internet traffic off course, how to spot them and what networks do to stop them.

Key takeaways

  • A hijack is a false claim about who owns or reaches a block of addresses, whether it comes from a typo or from intent.
  • A route leak is a real route sent in the wrong direction, often turning a small network into an accidental transit path.
  • A more specific prefix beats a less specific one, which is why a sub-prefix hijack spreads so effectively.
  • Filtering, origin validation, prefix limits and monitoring each stop some failures, and none stops all of them.
  • Encryption such as TLS protects the content of traffic that is misrouted, but it cannot keep the traffic flowing.

A BGP hijack happens when a network announces that it can reach addresses it has no right to originate, and other networks believe it. A route leak happens when a network passes along routes it learned legitimately to neighbors that should never have received them. In both cases traffic goes somewhere it shouldn't, and the sites behind those addresses can become slow, unreachable or exposed to interception.

The root cause is that the Border Gateway Protocol, which networks use to tell each other what they can reach, was designed for a small community that largely trusted itself. It carries claims, and it has no built-in way to prove them.

How routers come to believe a route

Each large network on the internet is an autonomous system with its own number. If those terms are new, start with how BGP works. A network announces prefixes, which are blocks of addresses such as 203.0.113.0/24, to its neighbors. Each neighbor that accepts the announcement adds its own number to the AS path and may pass it on.

A router that hears several routes to the same prefix picks one using local policy first, then tie-breakers such as a shorter AS path. Policy usually reflects money: routes from paying customers are preferred over routes from peers, and both over routes from providers that charge you.

One rule comes before all of that. When forwarding a packet, a router uses the longest prefix match, meaning the most specific route that covers the destination. A /24 wins over a /22 that contains it, however attractive the /22 looks.

Types of hijack

The simplest is an origin hijack. The legitimate holder announces 203.0.113.0/24 from its own AS, and a second AS announces exactly the same prefix. The internet splits: each network picks whichever origin its policy prefers, often the closer one.

A sub-prefix hijack is more severe. The holder announces a /22, and someone else announces a /24 inside it. Longest prefix match means nearly everyone who receives the /24 sends those addresses to the wrong place.

A forged-origin hijack keeps the real holder's AS number at the end of the path and inserts the offending network in front of it. The route looks as though it goes through that network to the true owner, so a check of the origin alone passes.

There is also squatting: announcing address space or AS numbers that nobody is using, to send abusive traffic from addresses with no bad reputation.

Four ways a route can be wrong
Same prefix A second network claims your exact block The internet splits between the two origins Origin validation can reject it More specific A smaller block inside yours is announced Longest match draws traffic to it Spreads very widely if accepted Forged origin Your AS number stays at the end of the path The offender appears just before it Origin check alone does not catch it Route leak Routes are genuine They are sent to the wrong neighbor Traffic floods a path not built for it Same prefix A second network claims your exact block The internet splits between the two origins Origin validation can reject it More specific A smaller block inside yours is announced Longest match draws traffic to it Spreads very widely if accepted Forged origin Your AS number stays at the end of the path The offender appears just before it Origin check alone does not catch it Route leak Routes are genuine They are sent to the wrong neighbor Traffic floods a path not built for it

What a route leak looks like

Networks follow a business logic about what to share. You announce your own routes and your customers' routes to everyone. You announce routes learned from your providers and peers only to your customers. Otherwise you would be offering to carry traffic between two larger networks for free.

Say a business buys internet service from two providers for redundancy. A configuration mistake makes its router re-announce everything learned from provider A to provider B. Provider B sees routes coming from a customer, and customer routes are preferred. Suddenly traffic from B toward large parts of the internet tries to squeeze through the business's two modest links. Those links saturate, and users far away see timeouts.

RFC 7908 defines a route leak as the propagation of routing announcements beyond their intended scope, and sorts leaks into several types. The pattern above, passing one provider's routes to another, is the classic one.

Why the damage spreads and how long it lasts

BGP changes propagate from neighbor to neighbor, so a bad announcement can reach distant networks within minutes. Fixing it requires the offending network to withdraw the route, or its neighbors to filter it. If the people responsible are asleep, unreachable or unaware, the problem continues.

The visible effects vary by where you sit. Some users reach a service normally because their provider rejected the bad route. Others see nothing but timeouts. This unevenness makes these events confusing to diagnose, and it is one reason a single routing mistake can resemble a much larger outage.

Misrouted traffic can have several fates:

  • It is dropped, because the receiving network has nowhere to send it. This is often called a blackhole.
  • It reaches an impostor service that answers in place of the real one.
  • It is carried through the offending network and then on to the true destination, adding delay while passing through hands that can observe it.

The third case is the hardest to notice, because things still work.

What encryption does and doesn't cover

If your connection uses TLS, someone who merely receives the packets cannot read them or pose as the site without a certificate your browser trusts. That is a strong protection.

It has limits. Metadata such as source and destination addresses stays visible. Availability is not protected at all. And because certificate authorities often confirm control of a domain by connecting over the network, a hijack at the right moment is a risk to issuance too. Many authorities reduce it by checking from several vantage points. Certificate Transparency logs give domain owners a way to notice certificates they didn't request.

Defenses networks use

No single control is enough, so operators stack them.

Prefix filtering. A provider accepts from each customer only the prefixes that customer is entitled to announce. The lists are usually built from Internet Routing Registry records and from signed data. This is the most effective place to stop a bad route, at its first hop.

Route origin validation. With RPKI, address holders publish signed statements naming which AS may originate each prefix. Routers can reject announcements that contradict them.

Maximum prefix limits. A router shuts down or alerts on a session if a neighbor suddenly sends far more routes than expected. This is a blunt but effective guard against full-table leaks.

BGP roles. RFC 9234 lets two neighbors declare their relationship (provider, customer, peer) and marks routes that should only travel toward customers, so a leak can be detected automatically.

Path checks. Work on AS Provider Authorization (ASPA) aims to let a network publish which providers it uses, so implausible paths can be spotted. BGPsec, which signs each hop of the path, is standardized but has seen little deployment.

Operators also sign up to shared codes of practice such as MANRS (Mutually Agreed Norms for Routing Security), which lists filtering, anti-spoofing, coordination and validation as baseline actions.

Stacked defenses against bad routes
Filter at the customer edge Accept only prefixes each customer is entitled to announce. Validate the origin Drop routes that contradict signed authorizations. Limit and label Cap prefix counts and enforce neighbor roles to catch leaks. Monitor from outside Watch how other networks see your prefixes and alert on changes. Protect the traffic Use encryption so misrouted data stays unreadable. Filter at the customer edge Accept only prefixes each customer is entitled to announce. Validate the origin Drop routes that contradict signed authorizations. Limit and label Cap prefix counts and enforce neighbor roles to catch leaks. Monitor from outside Watch how other networks see your prefixes and alert on changes. Protect the traffic Use encryption so misrouted data stays unreadable.

What you can do if you hold address space

If your organization announces its own prefixes, or a provider does it for you, you have real work to do.

  1. Create route origin authorizations for every prefix you announce, and set the maximum length no wider than what you actually send.
  2. Keep your registry records and contact details current, so others can reach you quickly.
  3. Sign up for route monitoring that alerts on new origins, new more-specific prefixes and unexpected paths.
  4. Ask your providers whether they filter customers and drop invalid routes.
  5. Write down an incident plan: who calls whom, and which more-specific announcements you could make to win traffic back.

Announcing more specifics is a common emergency response, but it only goes so far. Most networks refuse IPv4 prefixes longer than /24, so if the hijacked route is already a /24, you can't outbid it that way.

What ordinary users and site owners can do

You can't fix BGP from your living room. What you can do is recognize the signs. A service that fails from one internet provider and works from another, with DNS answering correctly, suggests a routing problem somewhere between you and it.

A traceroute may show the path wandering into an unexpected network or country, though reading it takes care. Our traceroute guide explains the traps. Public looking-glass servers and route collectors let you check which AS others see originating a prefix.

If you run a website without your own address space, your exposure runs through your host, DNS provider and content delivery network. Asking them about their routing security is reasonable, especially for services where an outage or interception would be costly. And keep TLS enforced everywhere, because it is the layer you fully control.

Common questions

Is every hijack an attack?

No. Many are mistakes: a mistyped prefix, an old configuration reused, or a filter removed during maintenance. From the outside, an error and a deliberate act can look identical, which is why defenses focus on rejecting wrong routes regardless of motive.

Can a firewall stop a hijack?

A firewall protects the boundary of your own network. A hijack changes how other networks send packets toward you, so those packets may never arrive at your firewall at all.

Does IPv6 avoid the problem?

No. IPv6 routes are exchanged with the same protocol and the same trust model. The same filtering, origin validation and monitoring apply to both address families, and it is easy to secure one and forget the other.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in IP Addresses & Routing →

Latest news on this topic