CDN Loop PreventionAkamai Technologiessludin@akamai.comFastlymnot@fastly.comCloudflarenick@cloudflare.com
General
HTTP Working GroupInternet-DraftThis specification defines the CDN-Loop request header field for HTTP.In modern deployments of HTTP servers, it is common to interpose Content Delivery Networks (CDNs) to improve end-user perceived latency, reduce operational costs, and improve scalability and reliability of services.Often, more than one CDN is in use by any one server; this happens for a variety of reasons, such as cost savings, arranging for failover should one CDN have issues, or to directly compare their services.As a result, it is not unknown for CDNs to be configured in a “loop” accidentally; because routing is achieved through a combination of DNS and forwarding rules, and site configurations are sometimes complex and managed by several parties.When this happens, it is difficult to debug. Additionally, it sometimes isn’t accidental; loops between multiple CDNs be used as an attack vector (e.g., see ), especially if one CDN unintentionally strips the loop detection headers of another.HTTP defines the Via header field in for “tracking message forwards, avoiding request loops, and identifying the protocol capabilities of senders along the request/response chain.”In theory, Via could be used to identify these loops. However, in practice it is not used in this fashion, because some HTTP servers use Via for other purposes – in particular, some implementations disable some HTTP/1.1 features when the Via header is present.This specification defines the CDN-Loop request header field for HTTP, to address this shortcoming.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 when, and only when, they appear in all capitals, as shown here.This specification uses the Augmented Backus-Naur Form (ABNF) notation of with a list extension, defined in , that allows for compact definition of comma-separated lists using a ‘#’ operator (similar to how the ‘*’ operator indicates repetition). Additionally, it uses the OWS rule from and the parameter rule from .The CDN-Loop request header field is intended to help a Content Delivery Network identify when an incoming request has already passed through that CDN’s servers, to prevent loops.Conforming Content Delivery Networks SHOULD add a value to this header field to all requests they generate or forward (creating the header if necessary).The token identifies the CDN as a whole. Chosen token values SHOULD be unique enough that a collision with other CDNs is unlikely. Optionally, the token can have semicolon-separated key/value parameters, to accommodate additional information for the CDN’s use.As with all HTTP headers defined using the “#” rule, the CDN-Loop header can be added to by comma-separating values, or by creating a new header field with the desired value.For example:Note that the token syntax does not allow whitespace, DQUOTE or any of the characters “(),/:;<=>?@[]{}”. See . Likewise, note the rules for when parameter values need to be quoted in .To be effective, intermediaries – including Content Delivery Networks – MUST NOT remove this header field, or allow it to be removed (e.g., through configuration) and servers (including intermediaries) SHOULD NOT use it for other purposes.The CDN-Loop header field can be generated by any client, and therefore its contents cannot be trusted. CDNs who modify their behaviour based upon its contents should assure that this does not become an attack vector (e.g., for Denial-of-Service).It is possible to sign the contents of the header (either by putting the signature directly into the field’s content, or using another header field), but such use is not defined (or required) by this specification.This document registers the “CDN-Loop” header field in the Permanent Message Header Field Names registry.Header Field Name: CDN-LoopProtocol: httpStatus: standardReference: (this document)Key words for use in RFCs to Indicate Requirement LevelsHypertext Transfer Protocol (HTTP/1.1): Message Syntax and RoutingAmbiguity of Uppercase vs Lowercase in RFC 2119 Key WordsAugmented BNF for Syntax Specifications: ABNFHypertext Transfer Protocol (HTTP/1.1): Semantics and ContentForwarding-Loop Attacks in Content Delivery Networks