idnits 2.17.1 draft-nottingham-http-new-status-04.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([2], [1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. -- The draft header indicates that this document updates RFC2616, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC2616, updated by this document, for RFC5378 checks: 1997-10-16) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 4, 2012) is 4437 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 2 errors (**), 0 flaws (~~), 1 warning (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Nottingham 3 Internet-Draft Rackspace 4 Updates: 2616 (if approved) R. Fielding 5 Intended status: Standards Track Adobe 6 Expires: August 7, 2012 February 4, 2012 8 Additional HTTP Status Codes 9 draft-nottingham-http-new-status-04 11 Abstract 13 This document specifies additional HyperText Transfer Protocol (HTTP) 14 status codes for a variety of common situations. 16 Editorial Note (To be removed by RFC Editor before publication) 18 Distribution of this document is unlimited. Although this is not a 19 work item of the HTTPbis Working Group, comments should be sent to 20 the Hypertext Transfer Protocol (HTTP) mailing list at 21 ietf-http-wg@w3.org [1], which may be joined by sending a message 22 with subject "subscribe" to ietf-http-wg-request@w3.org [2]. 24 Discussions of the HTTPbis Working Group are archived at 25 . 27 Status of this Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at http://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on August 7, 2012. 44 Copyright Notice 46 Copyright (c) 2012 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 62 2. Requirements . . . . . . . . . . . . . . . . . . . . . . . . . 3 63 3. 428 Precondition Required . . . . . . . . . . . . . . . . . . . 3 64 4. 429 Too Many Requests . . . . . . . . . . . . . . . . . . . . . 4 65 5. 431 Request Header Fields Too Large . . . . . . . . . . . . . . 4 66 6. 511 Network Authentication Required . . . . . . . . . . . . . . 5 67 7. Security Considerations . . . . . . . . . . . . . . . . . . . . 6 68 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 69 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 8 70 9.1. Normative References . . . . . . . . . . . . . . . . . . . 8 71 9.2. Informative References . . . . . . . . . . . . . . . . . . 8 72 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 8 73 Appendix B. Issues Raised by Captive Portals . . . . . . . . . . . 8 74 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 9 76 1. Introduction 78 This document specifies additional HTTP [RFC2616] status codes for a 79 variety of common situations, to improve interoperability and avoid 80 confusion when other, less precise status codes are used. 82 Note that these status codes are optional; servers cannot be required 83 to support them. However, because clients will treat unknown status 84 codes as a generic error of the same class (e.g., 499 is treated as 85 400 if it is not recognized), they can be safely deployed by existing 86 servers (see [RFC2616] Section 6.1.1 for more information). 88 2. Requirements 90 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 91 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 92 document are to be interpreted as described in [RFC2119]. 94 3. 428 Precondition Required 96 The 428 status code indicates that the origin server requires the 97 request to be conditional. 99 Its typical use is to avoid the "lost update" problem, where a client 100 GETs a resource's state, modifies it, and PUTs it back to the server, 101 when meanwhile a third party has modified the state on the server, 102 leading to a conflict. By requiring requests to be conditional, the 103 server can assure that clients are working with the correct copies. 105 Responses using this status code SHOULD explain how to resubmit the 106 request successfully. For example: 108 HTTP/1.1 428 Precondition Required 109 Content-Type: text/html 111 112 113 Precondition Required 114 115 116

Precondition Required

117

This request is required to be conditional; 118 try using "If-Match".

119 120 121 Responses with the 428 status code MUST NOT be stored by a cache. 123 4. 429 Too Many Requests 125 The 429 status code indicates that the user has sent too many 126 requests in a given amount of time ("rate limiting"). 128 The response representations SHOULD include details explaining the 129 condition, and MAY include a Retry-After header indicating how long 130 to wait before making a new request. 132 For example: 134 HTTP/1.1 429 Too Many Requests 135 Content-Type: text/html 136 Retry-After: 3600 138 139 140 Too Many Requests 141 142 143

Too Many Requests

144

I only allow 50 requests per hour to this Web site per 145 logged in user. Try again soon.

146 147 149 Note that this specification does not define how the origin server 150 identifies the user, nor how it counts requests. For example, an 151 origin server that is limiting request rates can do so based upon 152 counts of requests on a per-resource basis, across the entire server, 153 or even among a set of servers. Likewise, it might identify the user 154 by its authentication credentials, or a stateful cookie. 156 Responses with the 429 status code MUST NOT be stored by a cache. 158 5. 431 Request Header Fields Too Large 160 The 431 status code indicates that the server is unwilling to process 161 the request because its header fields are too large. The request MAY 162 be resubmitted after reducing the size of the request header fields. 164 It can be used both when the set of request header fields in total 165 are too large, and when a single header field is at fault. In the 166 latter case, the response representation SHOULD specify which header 167 field was too large. 169 For example: 171 HTTP/1.1 431 Request Header Fields Too Large 172 Content-Type: text/html 174 175 176 Request Header Fields Too Large 177 178 179

Request Header Fields Too Large

180

The "Example" header was too large.

181 182 184 Responses with the 431 status code MUST NOT be stored by a cache. 186 6. 511 Network Authentication Required 188 The 511 status code indicates that the client needs to authenticate 189 to gain network access. 191 The response representation SHOULD contain a link to a resource that 192 allows the user to submit credentials (e.g. with a HTML form). 194 Note that the 511 response SHOULD NOT contain a challenge or the 195 login interface itself, because browsers would show the login 196 interface as being associated with the originally requested URL, 197 which may cause confusion. 199 The 511 status SHOULD NOT be generated by origin servers; it is 200 intended for use by intercepting proxies that are interposed as a 201 means of controlling access to the network. 203 Responses with the 511 status code MUST NOT be stored by a cache. 205 6.1. The 511 Status Code and Captive Portals 207 The 511 status code is designed to mitigate problems caused by 208 "captive portals" to software (especially non-browser agents) that is 209 expecting a response from the server that a request was made to, not 210 the intervening network infrastructure. It is not intended to 211 encouraged deployment of captive portals, only to limit the damage 212 caused by them. 214 A network operator wishing to require some authentication, acceptance 215 of terms or other user interaction before granting access usually 216 does so by identifing clients who have not done so ("unknown 217 clients") using their MAC addresses. 219 Unknown clients then have all traffic blocked, except for that on TCP 220 port 80, which is sent to a HTTP server (the "login server") 221 dedicated to "logging in" unknown clients, and of course traffic to 222 the login server itself. 224 For example, a user agent might connect to a network and make the 225 following HTTP request on TCP port 80: 227 GET /index.htm HTTP/1.1 228 Host: www.example.com 230 Upon receiving such a request, the login server would generate a 511 231 response: 233 HTTP/1.1 511 Network Authentication Required 234 Content-Type: text/html 236 237 238 Network Authentication Required 239 241 242 243

You need to 244 authenticate with the local network in order to gain 245 access.

246 247 249 Here, the 511 status code assures that non-browser clients will not 250 interpret the response as being from the origin server, and the META 251 HTML element redirects the user agent to the login server. 253 7. Security Considerations 255 7.1. 428 Precondition Required 257 The 428 status code is optional; clients cannot rely upon its use to 258 prevent "lost update" conflicts. 260 7.2. 429 Too Many Requests 262 When a server is under attack or just receiving a very large number 263 of requests from a single party, responding to each with a 429 status 264 code will consume resources. 266 Therefore, servers are not required to use the 429 status code; when 267 limiting resource usage, it may be more appropriate to just drop 268 connections, or take other steps. 270 7.3. 431 Request Header Fields Too Large 272 Servers are not required to use the 431 status code; when under 273 attack, it may be more appropriate to just drop connections, or take 274 other steps. 276 7.4. 511 Network Authentication Required 278 In common use, a response carrying the 511 status code will not come 279 from the origin server indicated in the request's URL. This presents 280 many security issues; e.g., an attacking intermediary may be 281 inserting cookies into the original domain's name space, may be 282 observing cookies or HTTP authentication credentials sent from the 283 user agent, and so on. 285 However, these risks are not unique to the 511 status code; in other 286 words, a captive portal that is not using this status code introduces 287 the same issues. 289 Also, note that captive portals using this status code on an SSL or 290 TLS connection (commonly, port 443) will generate a certificate error 291 on the client. 293 8. IANA Considerations 295 The HTTP Status Codes Registry should be updated with the following 296 entries: 298 o Code: 428 299 o Description: Precondition Required 300 o Specification: [ this document ] 302 o Code: 429 303 o Description: Too Many Requests 304 o Specification: [ this document ] 305 o Code: 431 306 o Description: Request Header Fields Too Large 307 o Specification: [ this document ] 309 o Code: 511 310 o Description: Network Authentication Required 311 o Specification: [ this document ] 313 9. References 315 9.1. Normative References 317 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 318 Requirement Levels", BCP 14, RFC 2119, March 1997. 320 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 321 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 322 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 324 9.2. Informative References 326 [RFC4791] Daboo, C., Desruisseaux, B., and L. Dusseault, 327 "Calendaring Extensions to WebDAV (CalDAV)", RFC 4791, 328 March 2007. 330 [RFC4918] Dusseault, L., "HTTP Extensions for Web Distributed 331 Authoring and Versioning (WebDAV)", RFC 4918, June 2007. 333 URIs 335 [1] 337 [2] 339 Appendix A. Acknowledgements 341 Thanks to Jan Algermissen and Julian Reschke for their suggestions 342 and feedback. 344 Appendix B. Issues Raised by Captive Portals 346 Since clients cannot differentiate between a portal's response and 347 that of the HTTP server that they intended to communicate with, a 348 number of issues arise. The 511 status code is intended to help 349 mitigate some of them. 351 One example is the "favicon.ico" 352 commonly used by browsers to 353 identify the site being accessed. If the favicon for a given site is 354 fetched from a captive portal instead of the intended site (e.g., 355 because the user is unauthenticated), it will often "stick" in the 356 browser's cache (most implementations cache favicons aggressively) 357 beyond the portal session, so that it seems as if the portal's 358 favicon has "taken over" the legitimate site. 360 Another browser-based issue comes about when P3P 361 is supported. Depending on how it is 362 implemented, it's possible a browser might interpret a portal's 363 response for the p3p.xml file as the server's, resulting in the 364 privacy policy (or lack thereof) advertised by the portal being 365 interpreted as applying to the intended site. Other Web-based 366 protocols such as WebFinger 367 , CORS 368 and OAuth 369 may also be 370 vulnerable to such issues. 372 Although HTTP is most widely used with Web browsers, a growing number 373 of non-browsing applications use it as a substrate protocol. For 374 example, WebDAV [RFC4918] and CalDAV [RFC4791] both use HTTP as the 375 basis (for remote authoring and calendaring, respectively). Using 376 these applications from behind a captive portal can result in 377 spurious errors being presented to the user, and might result in 378 content corruption, in extreme cases. 380 Similarly, other non-browser applications using HTTP can be affected 381 as well; e.g., widgets , software 382 updates, and other specialised software such as Twitter clients and 383 the iTunes Music Store. 385 It should be noted that it's sometimes believed that using HTTP 386 redirection to direct traffic to the portal addresses these issues. 387 However, since many of these uses "follow" redirects, this is not a 388 good solution. 390 Authors' Addresses 392 Mark Nottingham 393 Rackspace 395 Email: mnot@mnot.net 396 URI: http://www.mnot.net/ 397 Roy T. Fielding 398 Adobe Systems Incorporated 399 345 Park Ave 400 San Jose, CA 95110 401 USA 403 Email: fielding@gbiv.com 404 URI: http://roy.gbiv.com/