Axisdream
Written and Published byAxisdream·

How RPKI Stops an Internet Network From Hijacking IP Address Blocks

Editorial cover for How RPKI Stops an Internet Network From Hijacking IP Address Blocks

Standardized in IETF RFC 9582 and deployed across regional internet registries including RIPE NCC, Resource Public Key Infrastructure (RPKI) Route Origin Authorizations (ROAs) allow internet backbone routers to cryptographically verify whether an autonomous system is authorized to originate an IP address prefix before accepting its Border Gateway Protocol (BGP) route announcement.

Every time a user opens a website or sends an API request, packets travel across a global mesh of more than 75,000 independent networks called Autonomous Systems (AS), each identified by a unique Autonomous System Number (ASN). A telecom carrier, a cloud provider, a university, and a large bank each operate one or more Autonomous Systems. To know which neighbor leads toward a given destination IP address block, routers across the world exchange reachability maps using the Border Gateway Protocol (BGP). Designed in 1989 when the internet was a small community of cooperating research institutions, BGP contains zero built-in verification of whether a network actually owns the IP addresses it claims to serve.

How a single BGP typo or hijack redirects global internet traffic

In baseline BGP, routing works by word of mouth. If Autonomous System AS 64500 announces to its upstream internet service providers that it is the destination for the IPv4 block 198.51.100.0/24, neighboring routers accept that claim at face value, add their own ASN to the path list, and propagate the announcement across the globe within seconds.

Two things make an unverified BGP announcement dangerous. First, routers prefer paths with fewer Autonomous System hops. If an unauthorized network announces someone else's /24 address block, any internet provider closer to the impostor than to the real owner will route traffic to the impostor. Second, BGP routers always follow the longest-prefix match rule: a more specific address block always wins over a broader address block, regardless of how far away the announcer is. If a cloud provider legitimately announces a large /16 block containing 65,536 IP addresses (198.51.0.0/16), and a misconfigured or malicious network on the other side of the planet announces a narrower /24 slice of that exact same space (198.51.100.0/24), almost every router on Earth will immediately divert traffic for those 256 addresses to the /24 announcer.

Over the past two decades, fat-fingered router configuration errors and deliberate prefix hijacks have repeatedly blackholed major cloud providers, intercepted unencrypted email and domain-name traffic to obtain fraudulent TLS certificates, and redirected cryptocurrency wallet servers to phishing clones. Just as safety-critical aviation communication networks require strict failure isolation so one faulty node cannot halt national airspace operations, the global internet backbone needs a way to verify prefix ownership without ripping out and replacing BGP on millions of routers.

How RPKI certificates and Route Origin Authorizations work

Resource Public Key Infrastructure (RPKI) solves origin hijacking by building an out-of-band cryptographic chain of trust anchored at the five Regional Internet Registries (ARIN, RIPE NCC, APNIC, LACNIC, and AFRINIC) that allocate IP address blocks and Autonomous System Numbers. When a regional registry assigns an IP prefix to an organization, it issues an X.509 cryptographic resource certificate confirming that the organization holds the rights to that specific range of IP addresses.

Using that certificate, the IP block holder creates and digitally signs a small cryptographic object called a Route Origin Authorization (ROA), whose format and validation rules are specified in IETF RFC 9582. A ROA contains three critical pieces of information:

  • The authorized origin Autonomous System Number (ASN) permitted to announce the route in BGP.
  • The IPv4 or IPv6 address prefix covered by the authorization (for example, 198.51.100.0/22).
  • An optional maxLength integer specifying the most specific prefix length that the authorized ASN is allowed to announce out of that block (for example, /24).
Signed ROAs are published in distributed public repositories hosted by the regional registries. Internet service providers and cloud operators do not run sluggish public-key cryptography directly on their high-speed hardware router line cards during live packet forwarding. Instead, each network runs a dedicated software daemon called an RPKI validator (or relying party cache) on a local server. The validator periodically downloads all published ROAs from the global registries, verifies their digital signatures and certificate chains, and pushes a compact, pre-validated table of (Prefix, MaxLength, Origin ASN) tuples to the network's border routers over the lightweight RPKI-to-Router (RTR) protocol.

Route Origin Validation states and the maxLength operational trap

When a border router configured for Route Origin Validation (ROV) receives a BGP route update from a peer, it looks up the announced prefix in its local RPKI cache and assigns one of three validation states:

  • Valid: At least one ROA covers the announced prefix, the route's origin ASN matches the ASN in the ROA, and the announced prefix length is less than or equal to the ROA's maxLength.
  • Invalid: A ROA exists for the address space, but either the origin ASN announcing the route does not match any authorized ASN, or the announced prefix is more specific (longer) than the permitted maxLength. Routers enforcing ROV immediately drop Invalid routes so the hijack never enters their forwarding table.
  • NotFound (or Unknown): No covering ROA exists in the global repository for that IP block yet, allowing incremental deployment across the internet without breaking legacy networks that have not signed ROAs.
Operator initiatives such as Mutually Agreed Norms for Routing Security (MANRS) warn against two common configuration mistakes when deploying ROAs. First, if an engineer creates a ROA for a /16 block with maxLength set to /24 even though the network only ever announces the /16 aggregate, a forged-origin attacker can announce a /24 subnet while spoofing the victim's ASN in the BGP path, and RPKI origin validation will still mark the forged /24 as Valid. Therefore, RFC 9582 recommends setting maxLength equal to the exact prefix lengths actually announced in production. Second, if an administrator changes upstream transit providers or deaggregates a prefix during a DDoS mitigation emergency without updating the ROA first, every ROV-enforcing backbone provider on Earth will immediately drop the organization's own traffic as Invalid.

Why RPKI origin validation cannot stop every BGP route leak

While RPKI Route Origin Validation blocks accidental typos and basic origin hijacks, it only verifies the very last Autonomous System at the origin of the BGP path (AS_PATH). It does not cryptographically verify the intermediate hops along the path. If an attacker takes a legitimate route originated by an authorized ASN (AS 64500) and prepends a fake adjacency (AS 64599 -> AS 64500), or if a multihomed regional network accidentally leaks routes learned from one major transit provider out to a second transit provider, the origin ASN at the end of the announcement is still AS 64500.

To an RPKI origin validator, that leaked or path-manipulated announcement still looks Valid because AS 64500 genuinely owns the prefix. Closing that remaining gap requires complementary routing security layers, including Autonomous System Provider Authorization (ASPA) objects stored in RPKI to verify valid customer-to-provider valley-free forwarding relationships, strict prefix-list filtering, and rapid vulnerability remediation across router control planes tracked in CISA KEV and EPSS patch prioritization workflows.

Sources

Related Dispatches