Network Working Group M. Nottingham Internet-DraftFebruary 15,April 5, 2018 Obsoletes: 5785 (if approved) Intended status: Standards Track Expires:August 19,October 7, 2018 Defining Well-Known Uniform Resource Identifiers (URIs)draft-nottingham-rfc5785bis-04draft-nottingham-rfc5785bis-05 Abstract This memo defines a path prefix for "well-known locations", "/.well- known/", in selected Uniform Resource Identifier (URI) schemes. Note to Readers _RFC EDITOR: please remove this section before publication_ This draft is a proposed revision of RFC5875. The issues list for this draft can be found at https://github.com/mnot/I-D/labels/rfc5785bis [1]. The most recent (often, unpublished) draft is at https://mnot.github.io/I-D/rfc5785bis/ [2]. Recent changes are listed at https://github.com/mnot/I-D/commits/gh- pages/rfc5785bis [3]. See also the draft's current status in the IETF datatracker, at https://datatracker.ietf.org/doc/draft-nottingham-rfc5785bis/ [4]. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire onAugust 19,October 7, 2018. Copyright Notice Copyright (c) 2018 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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 21.1. Appropriate Use of Well-Known URIs2. Notational Conventions . . . . . . . . . . .3 2. Notational Conventions. . . . . . . . 3 3. Well-Known URIs . . . . . . . . . . .4 3. Well-Known URIs. . . . . . . . . . . . 3 3.1. Registering Well-Known URIs . . . . . . . . . . . . . . . 4 4. Security Considerations . . . . . . . . . . . . . . . . . . . 55. IANA Considerations4.1. Interaction with the Web . . . . . . . . . . . . . . . . 5 4.2. Scoping Applications . . . . .5 5.1. The Well-Known URI Registry. . . . . . . . . . . . . 6 4.3. Hidden Capabilities . .5 5.1.1. Registration Template. . . . . . . . . . . . . . . .6. 7 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 5.1. The Well-Known URI Registry . . . . . . . . . . . . . . . 7 6. References . . . . . . . . . . . . . . . . . . . . . . . . .67 6.1. Normative References . . . . . . . . . . . . . . . . . .67 6.2. Informative References . . . . . . . . . . . . . . . . .78 6.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . .79 Appendix A. Frequently Asked Questions . . . . . . . . . . . . .89 Appendix B. Changes from RFC5785 . . . . . . . . . . . . . . . .810 Author's Address . . . . . . . . . . . . . . . . . . . . . . . .910 1. Introduction Some applications on the Web require the discovery of information about an origin [RFC6454] (sometimes called "site-wide metadata") before making a request. For example, the Robots Exclusion Protocol (http://www.robotstxt.org/ [5]) specifies a way for automated processes to obtain permission to access resources; likewise, the Platform for Privacy Preferences [W3C.REC-P3P-20020416] tells user- agents how to discover privacy policy before interacting with an origin server. While there are several ways to access per-resource metadata (e.g., HTTP headers, WebDAV's PROPFIND [RFC4918]), the perceived overhead (either in terms of client-perceived latency and/or deployment difficulties) associated with them often precludes their use in these scenarios. When this happens, one solution is designating a "well-known location" for data or services related to the origin overall, so that it can be easily located. However, this approach has the drawback of risking collisions, both with other such designated "well-known locations" and with resources that the origin has created (or wishes to create). At the same time, it has become more popular to use HTTP as a substrate for non-Web protocols. Sometimes, such protocols need a way to locate one or more resources on a given host. To addressthis,these uses, this memo defines a path prefix in HTTP(S) URIs for these "well-known locations", "/.well-known/". Future specifications that need to define a resource for such metadata can register their use to avoid collisions and minimise impingement upon origins' URI space. Well-known URIs can also be used with other URI schemes, but only when those schemes' definitions explicitly allow it.1.1. Appropriate Use of Well-Known URIs As per [RFC7320], "publishing independent standards that mandate particular forms of URI substructure is inappropriate, because that essentially usurps ownership." Well-known URIs are not an escape hatch from the requirements therein; they are a very limited carve- out of the path name space owned by the authority, ceded to standard use for a designated purpose. That purpose is to facilitate discovery of information about an origin when it isn't practical to use other mechanisms; for example, when discovering policy that needs to be evaluated before a resource is accessed, or when the information applies to many (or all) of the origin's resources. Typically, the resource(s) identified by a well-known URI will make information about the origin (e.g., policy) available directly, or provide references to other URIs that provide it. In general, that information should be applicable to most origins (i.e., Web sites - while acknowledging that some origins might not use a particular well-known location, for various reasons). In keeping with the Architecture of the World-Wide Web [W3C.REC-webarch-20041215], well-known URIs are not intended for general information retrieval or establishment of large URI namespaces. Specifically, well-known URIs are not a "protocol registry" for applications and protocols that wish to use HTTP as a substrate. Instead, such applications and protocols are encouraged to used an absolute URI to bootstrap their operation, rather than using a hostname and a well-known URI. Exceptionally, the registry expert(s) may approve such a registration for documents in the IETF Stream [RFC5741], in consultation with the IESG, provided that the protocol in question cannot be bootstrapped with a URI (e.g., the discovery mechanism can only carry a hostname). However, merely making it easier to locate it is not a sufficient reason. Likewise, future use unsupported by the specification in question is not sufficient reason to register a well-known location. Well-known locations are also not suited for information on topics other than the origin that they are located upon; for example, creating a well-known resource about a business entity or organisational structure presumes that Internet hosts and organisations share structure, and are likely to have significant deployment issues in environments where this is not true.2. Notational Conventions 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 RFC 2119 [RFC2119]. 3. Well-Known URIs A well-known URI is a URI [RFC3986] whose path component begins with the characters "/.well-known/", and whose scheme is "HTTP", "HTTPS", or another scheme that has explicitly been specified to use well- known URIs. Applications that wish to mint new well-known URIs MUST register them, following the procedures in Section 5.1. For example, if an application registers the name 'example', the corresponding well-known URI on 'http://www.example.com/' would be 'http://www.example.com/.well-known/example'. Registered names MUST conform to the segment-nz production in [RFC3986]. This means they cannot contain the "/" character.Note that this specification defines neither how to determine the authority to useRegistered names for aparticular context, nor the scope of the metadata discovered by dereferencing the well-known URI; both shouldspecific application SHOULD bedefined bycorrespondingly precise; "squatting" on generic terms is not encouraged. For example, if the Example applicationitself. Typically,wants a well-known location for metadata, an appropriate registered name might be "example-metadata" or even "example.com-metadata", not "metadata". At a minimum, a registration will reference a specification that defines the format and associated media type to be obtained by dereferencing the well-knownURI.URI, along with the URI scheme(s) that the well-known URI can be used with. If no URI schemes are explicitly specified, "HTTP" and "HTTPS" are assumed. It MAY also contain additional information, such as the syntax of additional path components, query strings and/or fragment identifiers to be appended to the well-known URI, or protocol-specific details (e.g., HTTP [RFC7231] method handling). Note that this specification defines neither how to determine the hostname to use to find the well-known URI for a particular application, nor the scope of the metadata discovered by dereferencing the well-known URI; both should be defined by the application itself. Also, this specification does not define a format or media-type for the resource located at "/.well-known/" and clients should not expect a resource to exist at that location. Well-known URIs are only valid when rooted in the top of the path's hierarchy; they MUST NOT be used in other parts of the path. For example, "/.well-known/example" is a valid use, but "/foo/.well- known/example" is not.4.See also Section 4 for Security ConsiderationsThis memo does not specifyregarding well-known locations. 3.1. Registering Well-Known URIs The "Well-Known URIs" registry is located at "https://www.iana.org/assignments/well-known-uris/". Registration requests can be made by following thescope of applicability of metadatainstructions located there orpolicy obtained from aby sending an email to the "wellknown-uri-review@ietf.org" mailing list. Registration requests consist of at least the following information: URI suffix: The name requested for the well-known URI,and doesrelative to "/.well-known/"; e.g., "example". Change controller: For Standards-Track RFCs, state "IETF". For others, give the name of the responsible party. Other details (e.g., postal address, e-mail address, home page URI) may also be included. Specification document(s): Reference to the document that specifies the field, preferably including a URI that can be used to retrieve a copy of the document. An indication of the relevant sections may also be included, but is notspecify howrequired. Related information: Optionally, citations todiscoveradditional documents containing further relevant information. General requirements for registered relation types are described in Section 3. Registrations MUST reference a freely available, stable specification. Note that well-known URIs can be registered by third parties (including the expert(s)), if the expert(s) determines that an unregistered well-known URIforis widely deployed and not likely to be registered in aparticular application. Individual applications using this mechanism must define both aspects.timely manner otherwise. Such registrations still are subject to the requirements defined, including the need to reference a specification. 4. Security Considerations Applications minting new well-known URIs, as well as administrators deploying them, will need to consider several security-related issues, including (but not limited to) exposure of sensitive data, denial-of-service attacks (in addition to normal load issues), server and client authentication, vulnerability to DNS rebinding attacks, and attacks where limited access to a server grants the ability to affect how well-known URIs are served.Security-sensitive4.1. Interaction with the Web In particular, applications using well-known URIs for HTTP or HTTPS URLs need to be aware that well-known resources will be accessible to Web browsers, and therefore is potentially able to be manipulated by content obtained from other parts of that origin. If an attacker is able to inject content (e.g., through a Cross-Site Scripting vulnerability), they will be able to make potentially arbitrary requests to the well-known resource. HTTP and HTTPS also use origins as a security boundary for many other mechanisms, including (but not limited to) Cookies [RFC6265], Web Storage [W3C.REC-webstorage-20160419] and many capabilities. Applications defining well-known locations should not assume that they have sole access to these mechanisms. Applications defining well-known URIs should not assume or require that they are the only application using the origin, since this is a common deployment pattern; instead, they should use appropriate mechanisms to mitigate the risks of co-existing with Web applications, such as (but not limited to): o Using Strict Transport Security [RFC6797] to assure that HTTPS is used o Using Content-Security-Policy [W3C.WD-CSP3-20160913] to constrain the capabilities of content, thereby mitigating Cross-Site Scripting attacks (which are possible if client-provided data is exposed in any part of a response in the application) o Using X-Frame-Options [RFC7034] to prevent content from being included in a HTML frame from another origin, thereby enabling "clickjacking" o Using Referrer-Policy [W3C.CR-referrer-policy-20170126] to prevent sensitive data in URLs from being leaked in the Referer request header o Using the 'HttpOnly' flag on Cookies to assure that cookies are not exposed to browser scripting languages [RFC6265] 4.2. Scoping Applications This memo does not specify the scope of applicability of metadata or policy obtained from a well-known URI, and does not specify how to discover a well-known URI for a particular application. Individual applications using this mechanism must define both aspects; if this is not specified, security issues can arise from implementation deviations and confusion about boundaries between applications. Applying metadata discovered in a well-known URI to resources other than those co-located on the same origin risks administrative as well as security issues. For example, allowing "https://example.com/.well-known/example" to apply policy to "https://department.example.com", "https://www.example.com" or even "https://www.example.com:8000" assumes a relationship between hosts where there may be none, or there may be conflicting motivations. 4.3. Hidden Capabilities Applications using well-known locations should consider that some server administrators might be unaware of its existence (especially on operating systems that hide directories whose names begin with "."). This means that if an attacker has write access to the.well-known.well- known directory, they would be able to control its contents, possibly without the administrator realising it. 5. IANA Considerations 5.1. The Well-Known URI Registry Thisdocument specifiesspecification updates the registration procedures for thewell-known URI"Well- Known URI" registry, first defined in[RFC5785].[RFC5785]; see Section 3.1. Well-known URIs are registered on the advice of one or more experts (appointed by the IESG or their delegate), with a Specification Required (using terminology from [RFC8126]).To allow for the allocation of values prior to publication, the expert(s) may approveThe Experts' primary considerations in evaluating registrationonce they are satisfied that such a specification will be published. Registrationrequestscan be sentare: * Conformance to thewellknown-uri- review@ietf.org mailing list for reviewrequirements in Section 3 * The availability andcomment, with an appropriate subject (e.g., "Request for well-known URI: example"). 5.1.1. Registration Template URI suffix:stability of the specifying document * Thename requested forsecurity considerations outlined in Section 4 IANA will direct any incoming requests regarding thewell-known URI, relativeregistry to"/.well-known/"; e.g., "example". Change controller: For Standards-Track RFCs, state "IETF". For others, givethis document and, if defined, thename ofprocesses established by theresponsible party. Other details (e.g., postal address, e-mail address, home page URI) may also be included. Specification document(s): Referenceexpert(s); typically, this will mean referring them to thedocument that specifies the field, preferably including a URIregistry Web page. IANA should replace all references to RFC 5988 in thatcan be usedregistry have been replaced with references toretrieve a copy of thethis document.An indication of the relevant sections may also be included, but is not required. Related information: Optionally, citations to additional documents containing further relevant information.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>. [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>.[RFC5741] Daigle, L., Ed., Kolkman, O., Ed., and IAB, "RFC Streams, Headers, and Boilerplates", RFC 5741, DOI 10.17487/RFC5741, December 2009, <https://www.rfc-editor.org/info/rfc5741>.[RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, DOI 10.17487/RFC6454, December 2011, <https://www.rfc-editor.org/info/rfc6454>.[RFC7320] Nottingham, M., "URI Design and Ownership", BCP 190, RFC 7320, DOI 10.17487/RFC7320, July 2014, <https://www.rfc-editor.org/info/rfc7320>.[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017, <https://www.rfc-editor.org/info/rfc8126>. 6.2. Informative References [RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, DOI 10.17487/RFC4918, June 2007, <https://www.rfc-editor.org/info/rfc4918>. [RFC5785] Nottingham, M. and E. Hammer-Lahav, "Defining Well-Known Uniform Resource Identifiers (URIs)", RFC 5785, DOI 10.17487/RFC5785, April 2010, <https://www.rfc-editor.org/info/rfc5785>. [RFC6265] Barth, A., "HTTP State Management Mechanism", RFC 6265, DOI 10.17487/RFC6265, April 2011, <https://www.rfc-editor.org/info/rfc6265>. [RFC6797] Hodges, J., Jackson, C., and A. Barth, "HTTP Strict Transport Security (HSTS)", RFC 6797, DOI 10.17487/RFC6797, November 2012, <https://www.rfc-editor.org/info/rfc6797>. [RFC7034] Ross, D. and T. Gondrom, "HTTP Header Field X-Frame- Options", RFC 7034, DOI 10.17487/RFC7034, October 2013, <https://www.rfc-editor.org/info/rfc7034>. [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>. [W3C.CR-referrer-policy-20170126] Eisinger, J. and E. Stark, "Referrer Policy", World Wide Web Consortium CR CR-referrer-policy-20170126, January 2017, <https://www.w3.org/TR/2017/CR-referrer-policy-20170126>. [W3C.REC-P3P-20020416] Marchiori, M., "The Platform for Privacy Preferences 1.0 (P3P1.0) Specification", World Wide Web Consortium Recommendation REC-P3P-20020416, April 2002, <http://www.w3.org/TR/2002/REC-P3P-20020416>.[W3C.REC-webarch-20041215] Jacobs, I. and N. Walsh, "Architecture of the[W3C.REC-webstorage-20160419] Hickson, I., "Web Storage (Second Edition)", World WideWeb, Volume One",Web Consortium Recommendation REC-webstorage-20160419, April 2016, <http://www.w3.org/TR/2016/REC-webstorage-20160419>. [W3C.WD-CSP3-20160913] West, M., "Content Security Policy Level 3", World Wide Web ConsortiumRecommendation REC-webarch-20041215, December 2004, <http://www.w3.org/TR/2004/REC-webarch-20041215>.WD WD-CSP3-20160913, September 2016, <https://www.w3.org/TR/2016/WD-CSP3-20160913>. 6.3. URIs [1] https://github.com/mnot/I-D/labels/rfc5785bis [2] https://mnot.github.io/I-D/rfc5785bis/ [3] https://github.com/mnot/I-D/commits/gh-pages/rfc5785bis [4] https://datatracker.ietf.org/doc/draft-nottingham-rfc5785bis/ [5] http://www.robotstxt.org/ Appendix A. Frequently Asked Questions 1. Aren't well-known locations bad for the Web? They are, but for various reasons - both technical and social - they are sometimes necessary. This memo defines a "sandbox" for them, to reduce the risks of collision and to minimise the impact upon pre-existing URIs on sites. 2. Why /.well-known? It's short, descriptive, and according to search indices, not widely used. 3. What impact does this have on existing mechanisms, such as P3P and robots.txt? None, until they choose to use this mechanism. 4. Why aren't per-directory well-known locations defined? Allowing every URI path segment to have a well-known location (e.g., "/images/.well-known/") would increase the risks of colliding with a pre-existing URI on a site, and generally these solutions are found not to scale well, because they're too "chatty".5. I want to use a well-known location to make it easy to configure my protocol that uses HTTP. This is not what well-known locations are for; see Section 1.1.Appendix B. Changes from RFC5785 oDiscuss appropriate and inappropriate uses more fullyAllow non-Web well-known locations o Adjust IANA instructions o Update references o Various other clarifications Author's Address Mark Nottingham Email: mnot@mnot.net URI: https://www.mnot.net/