You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-ietf-httpapi-digest-fields-problem-types.md
+23-18
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ This document specifies problem types that servers can use in responses to probl
56
56
57
57
# Introduction
58
58
59
-
{{DIGEST}} by design does not define, require or recommend any specific behavior for error handling relating to integrity. The responsibility is instead delegated to applications. This draft defines a set of problem types ({{PROBLEM}}) that can be used by server applications to indicate that a problem was encountered while dealing with a request carrying integrity fields and integrity preference fields.
59
+
{{DIGEST}} defines HTTP fields for exchanging integrity digests and preferences, but does not specify, require or recommend any specific behavior for error handling relating to integrity by design. The responsibility is instead delegated to applications. This draft defines a set of problem types ({{PROBLEM}}) that can be used by server applications to indicate that a problem was encountered while dealing with a request carrying integrity fields and integrity preference fields.
60
60
61
61
For example, a request message may include content alongside `Content-Digest` and `Repr-Digest` fields that use a digest algorithm the server does not support. An application could decide to reject this request because it cannot validate the integrity. Using a problem type, the server can provide machine-readable error details to aid debugging or error reporting, as shown in the following example.
62
62
@@ -87,7 +87,7 @@ interpreted as described in {{DIGEST}}.
87
87
The term "problem type" in this document is to be
88
88
interpreted as described in {{PROBLEM}}.
89
89
90
-
The term "request", "response", "intermediary", "sender", and "server" are from {{HTTP}}.
90
+
The terms "request", "response", "intermediary", "sender", and "server" are from {{HTTP}}.
91
91
92
92
# Problem Types
93
93
@@ -102,6 +102,10 @@ For this problem type, `unsupported-algorithm` is defined as the only extension
102
102
It SHOULD be populated in a response using this problem type, with its value being the algorithm key of the unsupported algorithm from the request.
103
103
The response can include the corresponding integrity preference field to indicate the server's algorithm support and preference.
104
104
105
+
This problem type is a hint to the client about algorithm support, which the client could use to retry the request with a different, supported, algorithm.
106
+
107
+
Note that a request may contain more than one integrity fields or integrity preference fields.
{: title="Response Advertising the Supported Algorithms"}
134
-
137
+
{: title="Response indicating the problem and advertising the supported algorithms"}
135
138
136
-
This problem type is a hint to the client about algorithm support, which the client could use to retry the request with a different, supported, algorithm.
137
-
Note that a request may contain more than one integrity field.
138
-
139
-
This problem type can also be used when a request contains an integrity preference field. For example:
139
+
This problem type can also be used when a request contains an integrity preference field with an unsupported algorithm. For example:
140
140
141
141
~~~ http-message
142
142
GET /items/123 HTTP/1.1
143
143
Host: foo.example
144
144
Want-Repr-Digest: sha=10
145
145
146
146
~~~
147
-
{: title="GET Request with Want-Repr-Digest"}
147
+
{: title="A request with a sha-256 integrity preference field, which is not supported by the server"}
{: title="Response Advertising the Supported Algorithms"}
162
+
{: title="Response indicating the problem and advertising the supported algorithms"}
163
163
164
164
## Invalid Digest Value
165
165
166
-
This section defines the "https://iana.org/assignments/http-problem-types#digest-invalid-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value, that cannot be generated by the corresponding hashing algorithm. For example, if the digest value of the `sha-512` hashing algorithm is not 64 bytes long, it cannot be a valid digest value and the server can skip computing the digest value. This problem type MUST NOT be used if the server is not able to parse the integrity fields according to {{Section 4.5 of STRUCTURED-FIELDS}}, for example because of a syntax error in the field value.
166
+
This section defines the "https://iana.org/assignments/http-problem-types#digest-invalid-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value, that cannot be generated by the corresponding hashing algorithm. For example, if the digest value of the `sha-512` hashing algorithm is not 64 bytes long, it cannot be a valid SHA-512 digest value and the server can skip computing the digest value. This problem type MUST NOT be used if the server is not able to parse the integrity fields according to {{Section 4.5 of STRUCTURED-FIELDS}}, for example because of a syntax error in the field value.
167
167
168
168
The server SHOULD include a human-readable description why the value is considered invalid in the `title` member.
169
169
170
+
This problem type indicates a fault in the sender's calculation or encoding of the digest value. A retry of the same request without modification will likely not yield a successful response.
171
+
170
172
The following example shows a request with the content `{"hello": "world"}` (plus LF), but the digest has been truncated. The subsequent response indicates the invalid SHA-512 digest.
{: title="Response indicating that the provided digest is too short"}
195
197
196
-
This problem type indicates a fault in the sender's calculation or encoding of the digest value. A retry of the same request without modification will likely not yield a successful response.
197
-
198
198
## Mismatching Digest Value
199
199
200
200
This section defines the "https://iana.org/assignments/http-problem-types#digest-mismatching-value" problem type. A server MAY use this problem type when responding to a request, whose integrity fields include a digest value that does not match the digest value that the server calculated for the request content or representation.
201
201
202
-
Two problem type extension members are defined: the `algorithm` and `provided-digest` members. A response using this problem type SHOULD populate all members, with the value of `algorithm` being the algorithm key of the used hashing algorithm and the value of `provided-digest` being the digest value taken from the request's integrity fields. The digest value MUST be serialized as byte sequences as described in {{Section 4.1.8 of STRUCTURED-FIELDS}}.
202
+
Two problem type extension members are defined: the `algorithm` and `provided-digest` members. A response using this problem type SHOULD populate all members, with the value of `algorithm` being the algorithm key of the used hashing algorithm and the value of `provided-digest` being the digest value taken from the request's integrity fields. The digest value is serialized as a byte sequence as described in {{Section 4.1.8 of STRUCTURED-FIELDS}}.
203
+
204
+
The problem type intentionally does not include the digest value calculated by the server to avoid attackers abusing this information for oracle attacks.
205
+
206
+
If the sender receives this problem type, the request might be modified unintentionally by an intermediary. The sender could use this information to retry the request without modification to address temporary transmission issues.
203
207
204
208
The following example shows a request with the content `{"hello": "woXYZ"}` (plus LF), but the representation digest for `{"hello": "world"}` (plus LF). The subsequent response indicates the mismatching SHA-256 digest values.
{: title="Response indicating the mismatching digests"}
231
235
232
-
If the sender receives this problem type, the request might be modified unintentionally by an intermediary. The sender could use this information to retry the request without modification to address temporary transmission issues.
233
-
234
236
# Security Considerations
235
237
236
238
Disclosing error details could leak information
@@ -240,6 +242,9 @@ Moreover, they can be used to fingerprint the server.
240
242
To mitigate these risks, a server could assess the risk of disclosing error details
241
243
and prefer a general problem type over a more specific one.
242
244
245
+
When a server informs the client about mismatching digest values, it should not expose
246
+
the calculated digest to avoid exposing information that can be abused for oracle attacks.
247
+
243
248
# IANA Considerations
244
249
245
250
IANA is asked to register the following entries in the "HTTP Problem Types" registry at <https://www.iana.org/assignments/http-problem-types>.
0 commit comments