The Use of Maxlength in the RPKI
Boston University
111 Cummington St, MCS135
Boston
MA
02215
USA
yossigi@bu.edu
Boston University
111 Cummington St, MCS135
Boston
MA
02215
USA
goldbe@cs.bu.edu
NIST
100 Bureau Drive
Gaithersburg
MD
20899
USA
kotikalapudi.sriram@nist.gov
Secure Internet routing
Resource public key infrastructure
This document recommends that operators avoid using the maxLength
attribute when issuing Route Origin Authorizations
(ROAs) in the Resource Public Key
Infrastructure (RPKI). These recommendations
complement those in .
The RPKI uses Route Origin Authorizations (ROAs) to create a trusted
mapping from an IP prefix to a set of autonomous systems (ASes) that
are authorized to originate this prefix. Each ROA contains a set of
IP prefixes, and an AS number of an AS authorized originate all the IP prefixes in the set
.
Each ROA is cryptographically signed by the party that is authorized to
allocate the set of IP prefixes.
The RPKI also supports a maxLength attribute. According to
,
"When present, the maxLength specifies the maximum length of the IP
address prefix that the AS is authorized to advertise."
Thus, rather than requiring the ROA to explictly list each prefix
the AS is authorized to originate, the maxLength attribute provides
a shorthand that authorizes an AS to announce a set of IP prefixes.
However, measurements of current RPKI deployments have
found that use of the maxLength in ROAs tends to lead to security
problems. Specifically, as of September 2016, 89% of the prefixes specified in ROAs
that use the maxLength attribute, are vulnerable to a
forged-origin subprefix hijack. The forged-origin subprefix hijack
affects any IP prefix that is authorized in ROA but is not announced
in BGP. The impact of such an attack is the same as standard subprefix
hijack on an IP prefix that is unprotected by a ROA in the RPKI.
For this reason, this document recommends that operators avoid using
the maxLength attribute in their ROAs as a best current practice.
Instead, ROAs should be consist of explicit lists of the IP prefixes that an
AS is authorized to announce, without using the maxLength attribute.
Whenever possible, this ROA should also be "miminal", in that it includes
only the list of IP prefixes that are actually originated in BGP. The
recommendations in this document clarify and extend the following
recommendation from :
One advantage of minimal ROA length is that the forged origin attack
does not work for sub-prefixes that are not covered by overly long
max length. For example, if, instead of 10.0.0.0/16-24, one issues
10.0.0.0/16 and 10.0.42.0/24, a forged origin attack cannot succeed
against 10.0.666.0/24. They must attack the whole /16, which is more
likely to be noticed because of its size.
These recommendations requires no changes to the RPKI specification
and will not increase the number
of signed ROAs in the RPKI, because ROAs already support lists of
IP prefixes .
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in
.
It is assumed that the reader understands BGP
, the RPKI
Route Origin Authorizations (ROAs) ,
RPKI-based Prefix Validation ,
and BGPSEC .
The forged-origin subprefix hijack is relevant to a scenario in
which
(1) the RPKI is deployed, and
(2) routers use RPKI origin validation to drop invalid routes , but
(3) BGPSEC is not deployed.
We describe the forged-origin subprefix hijack
using a running example.
Consider the IP prefix 168.122.0.0/16 which is allocated to an
organization that also operates AS 111. In BGP, AS 111 announces
the IP prefix 168.122.0.0/16 as well as its subprefix 168.122.225.0/24.
Therefore, the RPKI should contain a ROA authorizing AS 111 to
originate these two IP prefixes. That is, the ROA should be
ROA:(168.122.0.0/16,168.122.225.0/24, AS 111)
This ROA is "minimal"
because it includes only those two
prefixes that are actually originated by AS 111 in BGP.
Now suppose an attacking AS 666 originates
a BGP announcement for a subprefix 168.122.0.0/24. This is a standard
"subprefix hijack".
In the absence of
the minimal ROA above, AS 666 could intercept traffic for the addresses
in 168.122.0.0/24. This is because routers perform a longest-prefix match
when deciding where to forward IP packets, and 168.122.0.0/24 originated
by AS 666 is a longer prefix than 168.122.0.0/16 originated by AS 111.
However, the ROA above renders AS 666's BGP announcement invalid,
because (1) this ROA
"covers" the attacker's announcement (since 168.122.0.0/24 is a
subprefix of 168.122.0.0/16), and (2) there is no ROA "matching"
the attacker's announcement (there is no ROA for AS 666 and
IP prefix 168.122.0.0/24) .
If routers ignore invalid BGP announcements, the
minimal ROA above ensures that the subprefix hijack will fail.
Now suppose that instead the ROA above was replaced with a "loose ROA"
that used maxLength as a shorthand for set of IP prefixes that AS 111 is
authorized to announce. The ROA would be:
ROA:(168.122.0.0/16-24, AS 111)
This ROA authorizes AS 111 to originate any subprefix of
168.122.0.0/16, up to length /24. That is, AS 111 could originate
168.122.225.0/24 as well as all of 168.122.0.0/17, 168.122.128.0/17,
..., 168.122.255.0/24 but not 168.122.0.0/25.
However, AS 111 only originates two prefixes in BGP: 168.122.0.0/16
and 168.122.255.0/24. This means that all other prefixes authorized
by the loose ROA (for instance, 168.122.0.0/24), are
vulnerable to the following forged-origin subprefix hijack [RFC7115,]:
The hijacker AS 666 sends a BGP announcement
"168.122.0.0/24: AS 666, AS 111",
falsely claiming that AS 666 is a neighbor of AS 111
and falsely claiming that AS 111 originates the IP
prefix 168.122.0.0/24. In fact, the IP prefix 168.122.0.0/24
is not announced by AS 111.
The hijacker's BGP announcement is valid according the RPKI,
since the ROA (168.122.0.0/16-24, AS 111) authorizes AS 111 to
originate BGP routes for 168.122.0.0/24. Becaue AS 111 does not
actually originate a route for 168.122.0.0/24, the hijacker's route
is the *only* route to the 168.122.0.0/24. Longest-prefix-match
routing ensures that the hijacker's route to the subprefix
168.122.0.0/24 is always preferred over the legitimate route
to 168.122.0.0/16 announced by AS 111.
Thus, if the hijacker's route propagates through the Internet,
the hijacker will intercept traffic destined for IP
addresses in 168.122.0.0/24.
The forged origin *subprefix* hijack would have failed if
"minimal ROA" described above was used instead of the "loose ROA".
If the "minimal ROA" had been used instead, the attacker would be
forced to launch a forged origin *prefix* hijack in order to attract
traffic, as follows:
The hijacker AS 666 sends a BGP announcement
"168.122.0.0/16: AS 666, AS 111",
falsely claiming that AS 666 is a neighbor of AS 111.
Notice, however, that this hijack is significantly less effective
for the hijacker, since AS 111 is actually originating 168.122.0.0/16 in BGP.
In contrast to the forged-origin subprefix hijack,
with this hijack AS 666 is not presenting the *only* route
to 168.122.0.0/16.
Moreover, the path originated by AS 666 is one hop longer than the
path originated by the legitimate origin AS 111. As discussed in
, this means that the hijacker will attract
less traffic than he would have in the
forged origin *subprefix* hijack.
In sum, a forged-origin subprefix hijack has exactly the same
impact as a regular subprefix hijack.
A forged-origin subprefix
hijack is also more damaging than than forged-origin prefix hijack.
Any ROA with maxLength m longer than the prefix length p is vulnerable to a
forged-origin subprefix hijack, unless every subprefix of prefix
p of length m is legitimately announced in BGP.
Network measurements from September 13, 2016 show that 16% of the IP prefixes
authorized in ROAs have a maxLength longer than their prefix length.
The vast majority of these (89%) of these are vulnerable to
forged-origin subprefix hijacks. Even large providers are vulnerable
to these attacks. See for details.
These measurements suggest that operators commonly misconfigure the
maxLength attribute, and unwittingly open themselves up to
forged-origin subprefix hijacks.
This document recommends that operators avoid using the maxLength attribute
in their ROAs.
Operators should use "minimal ROAs" whenever possible.
A minimal ROA enumerates the exact list of IP prefixes that are actually
originated by an AS in BGP, as described in the running example of
.
Sometimes, it is not possible to use a "minimal
ROA", because an operator wants to issue a ROA that includes an IP prefix
that is sometimes (but not always) announced in BGP. In this case the ROA should
still consist of an explicit list of IP prefixes, including those
prefixes that are sometimes, but not always announced in BGP.
The list of prefixes should still avoid the use of the
maxLength attribute.
This practice requires no changes to the RPKI specification and will not increase the number
of signed ROAs in the RPKI, because ROAs already support lists of
IP prefixes .
See also for further discussion of
why this practice will have minimal
impact on the performance of the RPKI ecosystem.
We now extend our running example to illustrate one situation where
where it is not possible to issue a minimal ROA.
Suppose AS 111 has a contract with a DDoS mitigation service
provider that holds AS 222. When a DDoS attack is detected, AS 222
immediately originates 168.122.0.0/17 and 168.122.128.0/17, thus
attracting all the DDoS traffic to itself. The traffic is scrubbed at
AS 222 and then and sent back to AS 111 over a backhaul data link.
Notice that, during a DDoS attack, the DDoS mitigation service provider
AS 222 originates two /17 prefixes that are longer than
than AS 111's /16 prefix, and so all the traffic that normally goes
to AS 111 goes to AS 222 instead.
First, suppose the RPKI only had the minimal ROA for AS 111,
as described in . But, if there is
no ROA authorizing AS 222 to announce the two /17 prefixes,
then the traffic-scrubbing scheme would not work. That is,
if AS 222 originates the two /17 prefixes in BGP during a
DDoS attack, the announcement would be invalid
.
Instead, the RPKI should have two ROAs: one for AS 111 and one for AS 222.
ROA:(168.122.0.0/16,168.122.225.0/24, AS 111)
ROA:(168.122.0.0/17,168.122.128.0/17, AS 222)
Neither ROA uses the maxLength attribute. But, the second ROA is
not "minimal" because it contains two /17 prefixes that are not
announced by anyone in BGP during normal operations.
These two /17 prefixes are only announced by AS 222
as part of its DDoS mitigation service during
a DDoS attack.
Notice, however, that this scheme does not come without risks.
Namely, all of the IP addresses in 168.122.0.0/16 (except those in
68.122.225.0/24) are vulnerable to a forged-origin subprefix hijack
during normal operations, when the two /17 prefixes are not announced.
(The hijacker AS 666 would send the BGP announcement
`168.122.0.0/17: AS 666, AS 222'', falsely claiming that
AS 666 is a neighbor of AS 222 and falsely claiming
that AS 222 originates 168.122.0.0/17.)
Thus, a better approach would be to limit the address space in the ROA for
AS 222, so it includes only those IP addresses that must actively be
protected by the DDoS mitigation service provider.
For instance, if DDoS protection is contracted only for
those servers in AS 111 that have addresses in
168.122.0.0/23, then the following ROAs suffice:
ROA:(168.122.0.0/16,168.122.225.0/24, AS 111)
ROA:(168.122.0.0/23, AS 222)
Now, fewer IP addresses (namely, only those addresses in 168.122.0.0/23)
are vulnerable to forged origin subprefix hijacks, and DDoS mitigation service
could still protect these addresses during DDoS attacks.
This document would not be possible without the work of Omar Sagga
(Boston University).
Maxlength Considered Harmful to the RPKI
Rethinking Security for Internet Routing
Are We There Yet? On RPKI's Deployment and Security