RFC 8910
Captive-Portal Identification in DHCP and Router Advertisements (RAs)
RFC 8910 π Captive-Portal Identification in DHCP and Router Advertisements (RAs)
okay bestie, this is RFC 8910 π It's an Internet Engineering Task Force (IETF) Request for Comments, so it's a real spec that real networking gear follows β¨
- Authors: W. Kumari (Google) and E. Kline (Loon) π§
- Published: September 2020 π
- Category: Standards Track, so it's an official Internet Standards Track doc π₯
- ISSN: 2070-1721
- Obsoletes: RFC 7710 (it replaces that one, which was using DHCP code point 160 π)
- Updates: RFC 3679
Abstract
okay so in lots of places that offer short-term or temporary Internet access, like coffee shops, new connections usually start in captive portal mode π§ which seriously limits what you can do until you've met the captive portal conditions π
This document describes a DHCPv4 and DHCPv6 option, plus a Router Advertisement (RA) option, that tell clients they're behind some kind of captive portal enforcement device. They also tell clients they'll need to satisfy the Captive Portal conditions to get Internet access πΈ It is not a full solution for every problem clients might have with captive portals. It's meant to be one piece of a standardized approach for hosts to deal with these portals π«Ά The document covers how the network operator can pass the captive portal API endpoint to hosts, but the specific ways of satisfying and interacting with the portal are out of scope here π¦
This document replaces RFC 7710, which used DHCP code point 160. Because of a conflict, this document specifies 114 instead. That also means this document updates RFC 3679 β¨
Status of This Memo
This is an Internet Standards Track document π
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841 π
Information about the current status of this document, any errata, and how to give feedback on it can be found at https://www.rfc-editor.org/info/rfc8910 π
Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved. π
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please read these documents carefully, because they explain your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they are provided without warranty as described in the Simplified BSD License π
Table of Contents
1. Introduction
1.1. Requirements Notation
2. The Captive-Portal Option
2.1. IPv4 DHCP Option
2.2. IPv6 DHCP Option
2.3. The Captive-Portal IPv6 RA Option
3. Precedence of API URIs
4. IANA Considerations
4.1. Captive Portal Unrestricted Identifier
4.2. BOOTP Vendor Extensions and DHCP Options Code Change
4.3. Update DHCPv6 and IPv6 ND Options Registries
5. Security Considerations
6. References
6.1. Normative References
6.2. Informative References
Appendix A. Changes from RFC 7710
Appendix B. Observations from IETF 106 Network Experiment
Acknowledgements
Authors' Addresses
1. Introduction β¨
In many environments, users have to connect to a captive portal device and agree to an Acceptable Use Policy (AUP) and/or give billing info before they can get online π³ No matter how that mechanism works, this document gives clients a way to know when they're behind a captive portal and how to contact it π§
To show users the payment or AUP pages, a captive portal enforcement device currently has to intercept the user's connections and redirect them to a captive portal server. It does this with methods that are very similar to man-in-the-middle (MITM) attacks π¬ As more focus goes on security and end nodes take a more secure stance, these interception techniques will become less effective and/or more intrusive π
This document describes a DHCPv4 [RFC2131] and DHCPv6 [RFC8415] option (Captive-Portal), plus an IPv6 Router Advertisement (RA) [RFC4861] option. Together they tell clients that they're behind a captive portal enforcement device, and they give the API endpoint the host can contact for more info π¦
This document replaces RFC 7710 [RFC7710], which used DHCP code point 160. Because of a conflict, this document specifies 114. As a result, this document also updates [RFC3679] πΈ
1.1. Requirements Notation
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here π
2. The Captive-Portal Option π
The Captive-Portal DHCP/RA Option tells the client that it might be behind a captive portal, and it gives the URI for accessing an API defined by [RFC8908]. This is mainly meant to improve the user experience by showing the user the captive portal info faster and more reliably π Note that, for the foreseeable future, captive portals will still need interception techniques to serve legacy clients, and clients will still need to probe to detect captive portals π Even so, the mechanism in this document is a more reliable and performant way to do it, so it's the preferred mechanism for captive portal detection π
Clients that support the Captive Portal DHCP option SHOULD include the option in the Parameter Request List in DHCPREQUEST messages. DHCP servers MAY send the Captive Portal option without any explicit request π
To support multiple "classes" of clients (for example, IPv4 only, IPv6 only with DHCPv6 ([RFC8415]), and IPv6 only with RA), the captive network can provision the client with the URI through multiple methods: IPv4 DHCP, IPv6 DHCP, and IPv6 RA. The captive portal operator SHOULD ensure that the URIs provisioned by each method are identical, which reduces the chance of operational problems π§ The maximum length of a URI that can be carried in IPv4 DHCP is 255 bytes, so URIs longer than this SHOULD NOT be provisioned by any of the IPv6 options described in this document. In IPv6-only environments, this restriction can be relaxed π
In all variants of this option, the URI MUST be that of the captive portal API endpoint ([RFC8908]) π₯
A captive portal MAY do content negotiation (Section 3.4 of [RFC7231]) and try to redirect clients that query without an explicit indication of support for the captive portal API content type. In other words, the client's request doesn't have application/capport+json listed explicitly anywhere within an Accept header field, as described in Section 5.3 of [RFC7231] π In doing so, the captive portal SHOULD redirect the client to the value associated with the "user-portal-url" API key. When performing such content negotiation (Section 3.4 of [RFC7231]), captive portal implementors need to remember that such responses might be cached. For that reason they SHOULD include an appropriate Vary header field (Section 7.1.4 of [RFC7231]) or set the Cache-Control header field in any responses to "private" or a more restrictive value such as "no-store" (Section 5.2.2.3 of [RFC7234]) π
The URI SHOULD NOT contain an IP address literal. There are some exceptions, which might include networks with only one operational IP address family where DNS is either not available or not fully functional until the captive portal has been satisfied. Using IP Address certificates ([RFC3779]) adds considerations that are out of scope for this document π§
Networks with no captive portals may explicitly indicate this condition by using this option with the IANA-assigned URI for that purpose. Clients that observe the URI value "urn:ietf:params:capport:unrestricted" may forego time-consuming forms of captive portal detection β¨
2.1. IPv4 DHCP Option
Here's the format of the IPv4 Captive-Portal DHCP option π
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Code | Len | URI (variable length) ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. ...URI continued... .
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: Captive-Portal DHCPv4 Option Format
- Code: The Captive-Portal DHCPv4 Option (114) (one octet). π’
- Len: The length (one octet), in octets, of the URI. π
- URI: The URI for the captive portal API endpoint the user should connect to (encoded following the rules in [RFC3986]). π
See Section 2 of [RFC2132] for more on the format of IPv4 DHCP options π
Note that the URI parameter is not null terminated π
2.2. IPv6 DHCP Option
Here's the format of the IPv6 Captive-Portal DHCP option π§
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| option-code | option-len |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. URI (variable length) .
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: Captive-Portal DHCPv6 Option Format
- option-code: The Captive-Portal DHCPv6 Option (103) (two octets). π’
- option-len: The unsigned 16-bit length, in octets, of the URI. π
- URI: The URI for the captive portal API endpoint the user should connect to (encoded following the rules in [RFC3986]). π
See Section 5.7 of [RFC7227] for more examples of DHCP Options with URIs. See Section 21.1 of [RFC8415] for more on the format of IPv6 DHCP options π
Note that the URI parameter is not null terminated π
As the maximum length of a URI that can be carried in IPv4 DHCP is 255 bytes, URIs longer than this SHOULD NOT be provisioned via IPv6 DHCP options π
π¦ to be continued in part 2!
2.3. The Captive-Portal IPv6 RA Option β¨
okay bestie, this part is all about the Captive-Portal Router Advertisement option π§ it's the IPv6 version of the same idea, and the layout looks like this π
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Length | URI .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ .
. .
. .
. .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 3: Captive-Portal RA Option Format π
Type: the value is37πΈLength: an 8-bit unsigned integer. It's the length of the whole option, counting theTypeandLengthfields, measured in units of 8 bytes πURI: the URI for the captive portal API endpoint that the user should connect to π This MUST be padded with NUL (0x00) so the total option length (again, counting theTypeandLengthfields) is a multiple of 8 bytes. no skipping the padding, periodt π
Note that the URI parameter is not guaranteed to be null terminated, so don't go assuming it has a terminator π
Also, the maximum length of a URI you can carry in IPv4 DHCP is 255 bytes. So URIs longer than that SHOULD NOT be provisioned via IPv6 RA options π₯²
3. Precedence of API URIs β¨
okay so a device can learn about Captive Portal API URIs through more than one of these options, or honestly all of them at once π€― implementations get to pick their own precedence order. For example, they could prefer one of the IPv6 options over the DHCPv4 option, or the other way around, et cetera π
If the URIs learned via more than one option described in Section 2 are not all identical, this condition should be logged for the device owner or administrator. It's a network configuration error if the learned URIs don't all match π© not the vibe, bestie
4. IANA Considerations π
IANA registered a new IETF URN protocol parameter ([RFC3553]) π IANA also reallocated two DHCPv4 option codes (see Appendix B for background), and it updated the references for the DHCPv6 and IPv6 ND options that were already registered β¨
4.1. Captive Portal Unrestricted Identifier π¦
IANA added a new entry to the "IETF URN Sub-namespace for Registered Protocol Parameter Identifiers" registry defined in [RFC3553]:
Registered Parameter Identifier: capport:unrestricted
Reference: RFC 8910
IANA Registry Reference: RFC 8910
Only one value is defined (that's the URN above). No hierarchy is defined, so no sub-namespace registrations are possible π ββοΈ
4.2. BOOTP Vendor Extensions and DHCP Options Code Change π
IANA updated the "BOOTP Vendor Extensions and DHCP Options" registry (https://www.iana.org/assignments/bootp-dhcp-parameters) like this π
Tag: 114
Name: DHCP Captive-Portal
Data Length: N
Meaning: DHCP Captive-Portal
Reference: RFC 8910
Tag: 160
Name: Unassigned
Data Length:
Meaning: Previously assigned by [RFC7710]; known to also be used by
Polycom.
Reference: [RFC7710] RFC 8910
4.3. Update DHCPv6 and IPv6 ND Options Registries π§
IANA updated the DHCPv6 (103 - DHCP Captive-Portal) and IPv6 ND (37 - DHCP Captive-Portal) options that were previously registered in [RFC7710] so they now reference this document πβ¨
5. Security Considerations ππ₯
okay this section is SO important, bestie, so read it carefully π«Ά
By removing or reducing the need for captive portals to perform MITM hijacking, this mechanism improves security. It does this by making the portal and its actions visible instead of hidden π It also reduces the likelihood that users will disable useful security safeguards, like DNSSEC validation or VPNs, just so they can interact with the captive portal. Plus, because the system knows it's behind a captive portal, it can know not to send cookies, credentials, etc. And by handing out a URI that is protected with TLS, the captive portal operator can try to reassure the user that the portal isn't malicious π
Clients processing these options SHOULD validate that the option's contents conform to the validation requirements for URIs, including those described in [RFC3986]. no skipping this step, main character energy only π
Each of the options described in this document is presented to a node using the same protocols that are used to provision other information critical to the node's successful configuration on a network. The security considerations that apply to each of those provisioning mechanisms also apply when the node is trying to learn the information conveyed in these options. Without security measures like RA-Guard ([RFC6105], [RFC7113]) or DHCPv6-Shield [RFC7610], an attacker could inject, modify, or block DHCP messages or RAs ππ¨
An attacker who can inject DHCP messages or RAs could include an option from this document to force users to contact an address of the attacker's choosing. That attacker could also just list themselves as the default gateway (and intercept all the victim's traffic). That doesn't give them significantly more capabilities, but since this document removes the need for interception, the attacker may have an easier time pulling it off π
However, because the operating systems and applications that use this information know they're connecting to a captive portal device (unlike intercepted connections, where the OS or application may not know it's connecting to a captive portal or a hostile device), they can render the page in a sandboxed environment. They can also take other precautions, like clearly labeling the page as untrusted π‘οΈ The means of sandboxing, and a user interface that presents this information, aren't covered in this document. By their nature they're implementation specific, so they're best left to the application and user interface designers π¨
Devices and systems that automatically connect to an open network could potentially be tracked using the techniques described in this document. This could happen by forcing the user to keep resatisfying the Captive Portal conditions, or by exposing their browser fingerprint π» However, similar tracking can already be done with the presently common captive portal mechanisms, so this technique doesn't give attackers any more capabilities π€·ββοΈ
Captive portals are increasingly hijacking TLS connections to force browsers to talk to the portal. Providing the portal's URI via a DHCP or RA option is a cleaner technique, and it reduces user expectations of being hijacked. This may improve security by making users more reluctant to accept TLS hijacking, which can be performed from beyond the network associated with the captive portal πΈ
6. References β¨
6.1. Normative References π
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC2131] Droms, R., "Dynamic Host Configuration Protocol",
RFC 2131, DOI 10.17487/RFC2131, March 1997,
<https://www.rfc-editor.org/info/rfc2131>.
[RFC2132] Alexander, S. and R. Droms, "DHCP Options and BOOTP Vendor
Extensions", RFC 2132, DOI 10.17487/RFC2132, March 1997,
<https://www.rfc-editor.org/info/rfc2132>.
[RFC3553] Mealling, M., Masinter, L., Hardie, T., and G. Klyne, "An
IETF URN Sub-namespace for Registered Protocol
Parameters", BCP 73, RFC 3553, DOI 10.17487/RFC3553, June
2003, <https://www.rfc-editor.org/info/rfc3553>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005,
<https://www.rfc-editor.org/info/rfc3986>.
[RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman,
"Neighbor Discovery for IP version 6 (IPv6)", RFC 4861,
DOI 10.17487/RFC4861, September 2007,
<https://www.rfc-editor.org/info/rfc4861>.
[RFC7227] Hankins, D., Mrugalski, T., Siodelski, M., Jiang, S., and
S. Krishnan, "Guidelines for Creating New DHCPv6 Options",
BCP 187, RFC 7227, DOI 10.17487/RFC7227, May 2014,
<https://www.rfc-editor.org/info/rfc7227>.
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014,
<https://www.rfc-editor.org/info/rfc7231>.
[RFC7234] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,
Ed., "Hypertext Transfer Protocol (HTTP/1.1): Caching",
RFC 7234, DOI 10.17487/RFC7234, June 2014,
<https://www.rfc-editor.org/info/rfc7234>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8415] Mrugalski, T., Siodelski, M., Volz, B., Yourtchenko, A.,
Richardson, M., Jiang, S., Lemon, T., and T. Winters,
"Dynamic Host Configuration Protocol for IPv6 (DHCPv6)",
RFC 8415, DOI 10.17487/RFC8415, November 2018,
<https://www.rfc-editor.org/info/rfc8415>.
6.2. Informative References π
[RFC3679] Droms, R., "Unused Dynamic Host Configuration Protocol
(DHCP) Option Codes", RFC 3679, DOI 10.17487/RFC3679,
January 2004, <https://www.rfc-editor.org/info/rfc3679>.
[RFC3779] Lynn, C., Kent, S., and K. Seo, "X.509 Extensions for IP
Addresses and AS Identifiers", RFC 3779,
DOI 10.17487/RFC3779, June 2004,
<https://www.rfc-editor.org/info/rfc3779>.
[RFC6105] Levy-Abegnoli, E., Van de Velde, G., Popoviciu, C., and J.
Mohacsi, "IPv6 Router Advertisement Guard", RFC 6105,
DOI 10.17487/RFC6105, February 2011,
<https://www.rfc-editor.org/info/rfc6105>.
[RFC7113] Gont, F., "Implementation Advice for IPv6 Router
Advertisement Guard (RA-Guard)", RFC 7113,
DOI 10.17487/RFC7113, February 2014,
<https://www.rfc-editor.org/info/rfc7113>.
[RFC7610] Gont, F., Liu, W., and G. Van de Velde, "DHCPv6-Shield:
Protecting against Rogue DHCPv6 Servers", BCP 199,
RFC 7610, DOI 10.17487/RFC7610, August 2015,
<https://www.rfc-editor.org/info/rfc7610>.
[RFC7710] Kumari, W., Gudmundsson, O., Ebersman, P., and S. Sheng,
"Captive-Portal Identification Using DHCP or Router
Advertisements (RAs)", RFC 7710, DOI 10.17487/RFC7710,
December 2015, <https://www.rfc-editor.org/info/rfc7710>.
[RFC8908] Pauly, T., Ed. and D. Thakore, Ed., "Captive Portal API",
RFC 8908, DOI 10.17487/RFC8908, September 2020,
<https://www.rfc-editor.org/info/rfc8908>.
Appendix A. Changes from RFC 7710 π¦
This document incorporates the following changes from [RFC7710] π
- Clarified that IP string literals are NOT RECOMMENDED. π«
- Clarified that the option URI MUST be that of the captive portal API endpoint. π―
- Clarified that captive portals MAY do content negotiation. π
- Added text about Captive Portal API URI precedence in the event of a network configuration error. π©
- Added
urn:ietf:params:capport:unrestrictedURN. π - Noted that the DHCPv4 Option Code changed from 160 to 114. π’
Appendix B. Observations from IETF 106 Network Experiment β¨
Okay so, bestie, this appendix is a little story from IETF 106 in Singapore ππ During the meeting, there was an experiment (you can peek at the wiki if you want the details, it's giving field trip vibes π§) where clients that speak the Captive Portal API could discover a venue-info-url. The people running it wanted to see how it went, and the CAPPORT WG has more info on their page too π
Here's the tea: some Polycom devices on the same network were using DHCPv4 option code 160 for totally different stuff π Polycom has its own community thread about the whole 160-vs-66 mess if you're curious π
So when the Captive Portal API URL was sent in DHCPv4 option code 160, those Polycom phones just... didn't work the way they were supposed to π Not cute. Because of that, IANA deprecated option code 160 and gave a different value to the Captive Portal API URL instead π¦ Main character plot twist, honestly π
Acknowledgements
This document is a -bis of RFC 7710 πΈ Huge thank-you to the original authors, Warren Kumari, Olafur Gudmundsson, Paul Ebersman, and Steve Sheng, plus all the original contributors π«Ά
Also, the whole CAPPORT WG deserves a standing ovation π for all the discussion, improvements, and reviews. That includes Joe Clarke, Lorenzo Colitti, Dave Dolson, Hans Kuhn, Kyle Larose, Clemens Schimpe, Martin Thomson, Michael Richardson, Remi Nguyen Van, Subash Tirupachur Comerica, Bernie Volz, and Tommy Pauly πβ¨
Authors' Addresses
Warren Kumari Google 1600 Amphitheatre Parkway Mountain View, CA 94043 United States of America
Email: warren@kumari.net
Erik Kline Loon 1600 Amphitheatre Parkway Mountain View, CA 94043 United States of America
Email: ek@loon.com
That's the whole RFC, bestie! πππ
π¦ where this page comes from
- ietf: rfc8910 2020-09
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms