RFC 9532 | Next-Hop Aliases Proxy-Status Parameter | January 2024 |
Pauly | Standards Track | [Page] |
This document defines thenext-hop-aliases
HTTP Proxy-Status Parameter. This parameter carries the list of aliases and canonical names an intermediary received during DNS resolution as part of establishing a connection to the next hop.¶
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 provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc9532.¶
Copyright (c) 2024 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 review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The Proxy-Status HTTP response field[PROXY-STATUS] allows intermediaries to conveyinformation about how they handled the request in HTTP responses sent to clients.It defines a set of parameters that provide information, such as the name of the nexthop.¶
[PROXY-STATUS] defines anext-hop
parameter, which can contain a hostname,IP address, or alias of the next hop. This parameter can contain only one such item,so it cannot be used to communicate a chain of aliases encountered during DNS resolutionwhen connecting to the next hop.¶
Knowing the full chain of names that were used during DNS resolution via CNAME records[DNS] is particularly useful for clients of forward proxies, in which theclient is requesting to connect to a specific target hostname using the CONNECT method[HTTP] or UDP proxying[CONNECT-UDP]. CNAME records can be used to"cloak" hosts that perform tracking or malicious activity behind more innocuous hostnames,and clients such as web browsers use the chain of DNS names to influence behavior like cookieusage policies[COOKIES] or the blocking of malicious hosts.¶
This document allows clients to receive the CNAME chain of DNS names for the next hopby including the list of names in a newnext-hop-aliases
Proxy-Status parameter.¶
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.¶
The value of thenext-hop-aliases
parameter is a String[STRUCTURED-FIELDS] that containsone or more DNS names in a comma-separated list. The items in the list include all alias names andcanonical names received in CNAME records[DNS] during the course of resolving the next hop's hostname using DNS andMAY include the original requested hostname itself. The names ought to appear in the order in which they were received in DNS, for the sake of consistency. If there are multiple CNAME records in the chain, the first name in thenext-hop-aliases
list wouldbe the value in the CNAME record for the original hostname, and the final name in thenext-hop-aliases
list would be the name that ultimately resolved to one or more addresses.¶
The list of DNS names innext-hop-aliases
parameter uses a comma (",") as a separator between names.Note that if a comma is included in a name itself, the comma must be encoded as described inSection 2.1.¶
For example, consider a proxy "proxy.example.net" that receives the following records when performing DNS resolution for the next hop "host.example.com":¶
host.example.com. CNAME tracker.example.com.tracker.example.com. CNAME service1.example.com.service1.example.com. AAAA 2001:db8::1¶
The proxy could include the following proxy status in its response:¶
Proxy-Status: proxy.example.net; next-hop="2001:db8::1"; next-hop-aliases="tracker.example.com,service1.example.com"¶
This indicates that "proxy.example.net", which used the IP address "2001:db8::1" as the next hopfor this request, encountered the names "tracker.example.com" and "service1.example.com"in the DNS resolution chain. Note that while this example includes both thenext-hop
andnext-hop-aliases
parameters,next-hop-aliases
can be included without includingnext-hop
.¶
The proxy can also include the name of the next hop as the first item in the list. This isparticularly useful for reverse proxies when clients would not otherwise know the name of thenext hop, and thenext-hop
header is used to convey an IP address.¶
For example, consider a proxy "reverseproxy.example.net" that receives the following recordswhen performing DNS resolution for the next hop "host.example.com":¶
host2.example.com. CNAME service2.example.com.service2.example.com. AAAA 2001:db8::2¶
The proxy could include the following proxy status in its response:¶
Proxy-Status: reverseproxy.example.net; next-hop="2001:db8::2"; next-hop-aliases="host2.example.com,service2.example.com"¶
Thenext-hop-aliases
parameter only applies when DNS was used to resolve the next hop's name, and itdoes not apply in all situations. Clients can use the information in this parameter to determine how to use the connection established through the proxy, but they need to gracefully handle situations in which this parameter is not present.¶
The proxyMAY send the empty string ("") as the value ofnext-hop-aliases
parameter to indicate thatno CNAME records were encountered when resolving the next hop's name.¶
DNS names commonly contain just alphanumeric characters and hyphens ("-"), although theyare allowed to contain any character ([RFC1035],Section 3.1), including a comma. Toprevent commas or other special characters in names leading to incorrect parsing,any characters that appear in names in this list that do not belong to the set of URIunreserved characters ([RFC3986],Section 2.3)MUST be percent-encoded asdefined in[RFC3986],Section 2.1.¶
For example, consider the DNS name "comma,name.example.com". This name would be encodedwithin anext-hop-aliases
parameter as follows:¶
Proxy-Status: proxy.example.net; next-hop="2001:db8::1"; next-hop-aliases="comma%2Cname.example.com,service1.example.com"¶
It is also possible for a DNS name to include a period character (".") within a label instead of as a label separator. In this case, the period characterMUST first be escapedas "\.". Since the "\" character itself will be percent-encoded, the name"dot\.label.example.com" would be encoded within anext-hop-aliases
parameter as follows:¶
Proxy-Status: proxy.example.net; next-hop="2001:db8::1"; next-hop-aliases="dot%5C.label.example.com,service1.example.com"¶
Upon parsing this name, "dot%5C.label"MUST be treated as a single label.¶
Similarly, the "\" character in a labelMUST be escaped as "\\" and then percent-encoded. Other uses of "\"MUST NOT appear in the label after percent-decoding. For example, if there is a DNS name "backslash\name.example.com", it would first be escaped as "backslash\\name.example.com" and then percent-encoded as follows:¶
Proxy-Status: proxy.example.net; next-hop="2001:db8::1"; next-hop-aliases="backslash%5C%5Cname.example.com,s1.example.com"¶
In order to include thenext-hop-aliases
parameter, a proxy needs to have access to the chainof alias names and canonical names received in CNAME records.¶
Implementations ought to note that the full chain of names might not be available in common DNSresolution APIs, such asgetaddrinfo
[POSIX].getaddrinfo
does have an option forAI_CANONNAME
([RFC3493],Section 6.1), but this will only return the last name in the chain(the canonical name), not the alias names.¶
An implementationMAY include incomplete information in thenext-hop-aliases
parameter to accommodate cases where it is unable to include the full chain, such as only including the canonical name if the implementation can only usegetaddrinfo
as described above.¶
Thenext-hop-aliases
parameter does not include any DNSSEC information or imply that DNSSEC was used.The information included in the parameter can only be trusted to be valid insofar as the clienttrusts the proxy to provide accurate information. This information is intended to be used asa hint andSHOULD NOT be used for making security decisions about the identity of a resource accessedthrough the proxy.¶
Inspecting CNAME chains can be used to detect cloaking of trackers or malicious hosts. However, theCNAME records could be omitted by a recursive or authoritative resolver that is trying to hide this form of cloaking.In particular, recursive or authoritative resolvers can omit these records for both clients directly performing DNS nameresolution and proxies performing DNS name resolution on behalf of a client. A malicious proxy couldalso choose to not report these CNAME chains in order to hide the cloaking. In general, clients cantrust information included (or not included) in thenext-hop-aliases
parameter to the degreethat the proxy and any resolvers used by the proxy are trusted.¶
This document registers thenext-hop-aliases
parameterin the "HTTP Proxy-Status Parameters" registry<https://www.iana.org/assignments/http-proxy-status> as shown inTable 1.¶
Name | Description | Reference |
---|---|---|
next‑hop‑aliases | A string containing one or more DNS aliases or canonical names used to establish a proxied connection to the next hop. | RFC 9532 |