From cd7fa81275148be66f2023d39c2a45bcfdf611d2 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 15 Feb 2018 11:03:04 +0100 Subject: [PATCH] XEP-0363: Allow only white listed headers --- xep-0363.xml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xep-0363.xml b/xep-0363.xml index 0a524715..0d3b6aff 100644 --- a/xep-0363.xml +++ b/xep-0363.xml @@ -29,6 +29,17 @@ daniel@gultsch.de daniel@gultsch.de + + 0.5.0 + 2018-02-15 + dg + +
    +
  • Allow only a specific set of HTTP headers to be included in the request
  • +
  • Removed some inappropriate use of normative language
  • +
+
+
0.4.0 2017-12-03 @@ -187,7 +198,7 @@ content-type='image/jpeg' /> ]]>

The upload service responds with both a PUT and a GET URL wrapped by a <slot> element. The service SHOULD keep the file name and especially the file ending intact. Using the same hostname for PUT and GET is OPTIONAL. The host MUST provide Transport Layer Security (&rfc5246;).

-

The <put> element MAY also contain an unlimited number of <header> elements which correspond to HTTP header fields. Each <header> element MUST have a name-attribute and a content with the value of the header.

+

The <put> element MAY also contain a number of <header> elements which correspond to HTTP header fields. Each <header> element MUST have a name-attribute and a content with the value of the header. Only the following header names are allowed: Authorization, Cookie, Expires. Other header names MUST be ignored by the requesting entity and MUST NOT be included in the HTTP request. The requesting entity MUST strip any newline characters from the header name and value before performing the HTTP request.

Basic Base64String==
-
montague.tld
+
foo=bar; user=romeo
@@ -256,7 +267,7 @@

The actual upload of the file happens via HTTP-PUT and is out of scope of this document. The upload service MUST reject the file upload if the Content-Length does not match the size of the slot request. The service SHOULD reject the file if the Content-Type has been specified beforehand and does not match. The service MAY assume application/octet-stream as a Content-Type if it the client did not specify a Content-Type at all.

-

In addition to the Content-Length and Content-Type header the client MUST also include all additional headers that came with the slot assignment.

+

In addition to the Content-Length and Content-Type header the client MUST include all allowed headers that came with the slot assignment.

There is no further XMPP communication required between the upload service and the client. A HTTP status Code of 201 means that the server is now ready to serve the file via the provided GET URL. If the upload fails for whatever reasons the client MAY request a new slot.

@@ -266,6 +277,7 @@
  • Client implementors MUST consider the fact that without additional end-to-end-encryption files uploaded to a service described in this document will store those files in plain text on that service. Client implementors SHOULD either use this only for semi public files (for example files shared in a public MUC or a PEP Avatar) or implement appropriate end-to-end encryption.
  • Requesting entities MUST strip any newline characters from the HTTP header names and values before making the PUT request.
  • +
  • Requesting entities MUST ensure that only the headers that are explicitly allowed by this XEP (Authorization, Cookie, Expires) are copied from the slot response to the HTTP request.
  • Service implementors SHOULD use long randomized parts in their URLs making it impossible to guess the location of arbitrary files