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
@@ -90,25 +95,30 @@ interpreted as described in {{PROBLEM}}.
90
95
91
96
The terms "request", "response", "intermediary", "sender", "client", and "server" are from {{HTTP}}.
92
97
98
+
The problem types in this document are defined using JSON {{JSON}}. They can be serialized into an equivalent XML format as outlined in {{Appendix B of PROBLEM}}.
99
+
93
100
# Problem Types
94
101
95
102
The following section defines three problem types to express common problems that occur when handling integrity or integrity preference fields on the server. These problem types use the `digest-` prefix in their type URI. Other problem types that are defined outside this document, yet specific to digest related problems, may reuse this prefix.
96
103
97
-
## Unsupported Hashing Algorithm
104
+
Requests can include multiple integrity or integrity preference fields. For example, they may use the `Content-Digest` and `Repr-Digest` fields simultaneously or express preferences for content and representation digests at the same time. Therefore, similar problems can appear multiple times for one request. The problem types defined in this document allow expressing multiple appearances, while each time identifying the corresponding header that contained the problematic value.
105
+
106
+
## Unsupported Hashing Algorithms
98
107
99
-
This section defines the "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm" problem type.
100
-
A server MAY use this problem type if it wants to communicate to the client that
101
-
one of the hashing algorithms referenced in the integrity or integrity preference fields present in the request
102
-
is not supported.
108
+
This section defines the "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithms" problem type.
109
+
A server can use this problem type to communicate to the client that
110
+
one or more of the hashing algorithms referenced in the integrity or integrity preference fields present in the request
111
+
are not supported.
103
112
104
-
Two problem type extension members are defined, which SHOULD be populated for all responses using this problem type:
113
+
For this problem type, the `unsupported-algorithms` extension member is defined, whose value is a JSON {{JSON}} array of entries identifying each unsupported algorithm.
114
+
Each entry in the array is a JSON object with the following members:
105
115
106
-
- The `unsupported-algorithm` extension member identifies the unsupported algorithm from the request. Its value is the corresponding algorithm key.
107
-
- The `header` extension member as defined in {{identifying-problem-causing-headers}}.
116
+
- The `algorithm` member is a JSON string containing the algorithm key of the unsupported algorithm.
117
+
- The `header` member is a JSON string containing the name of the integrity or integrity preference field that referenced the unsupported algorithm.
108
118
109
119
The response can include the corresponding integrity preference field to indicate the server's algorithm support and preference.
110
120
111
-
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.
121
+
This problem type is a hint to the client about algorithm support, which the client could use to retry the request with different, supported, algorithms.
{: title="Response indicating the problem and advertising the supported algorithms"}
169
193
170
-
## Invalid Digest Value
171
-
172
-
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.
194
+
## Invalid Digest Values
173
195
174
-
One problemtype extension member is defined, which SHOULD be populated for all responses using this problem type:
196
+
This section defines the "https://iana.org/assignments/http-problem-types#digest-invalid-values" problem type. A server can 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.
175
197
176
-
- The `header` extension member as defined in {{identifying-problem-causing-headers}}.
198
+
For this problem type, the `invalid-digests` extension member is defined, whose value is a JSON {{JSON}} array of entries identifying each invalid digest.
199
+
Each entry in the array is a JSON object with the following members:
177
200
178
-
The server SHOULD include a human-readable description why the value is considered invalid in the `title` member.
201
+
- The `algorithm` member is a JSON string containing the algorithm key.
202
+
- The `header` member is a JSON string containing the name of the integrity field that contained the invalid digest value.
203
+
- The `reason` member is a JSON string containing a human-readable description why the value is considered invalid.
179
204
180
205
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.
"title": "digest value for sha-512 is not 64 bytes long",
204
-
"header": "Repr-Digest"
227
+
digest-invalid-values",
228
+
"title": "Invalid digest values",
229
+
"invalid-digests": [
230
+
{
231
+
"algorithm": "sha-512",
232
+
"header": "Repr-Digest",
233
+
"reason": "digest value is not 64 bytes long"
234
+
}
235
+
]
205
236
}
206
237
~~~
207
238
{: title="Response indicating that the provided digest is too short"}
208
239
209
-
## Mismatching Digest Value
240
+
## Mismatching Digest Values
210
241
211
-
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.
242
+
This section defines the "https://iana.org/assignments/http-problem-types#digest-mismatching-values" problem type. A server can 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.
212
243
213
-
Three problem type extension members are defined, which SHOULD be populated for all responses using this problem type:
244
+
For this problem type, the `mismatching-digests` extension member is defined, whose value is a JSON {{JSON}} array of entries identifying each mismatching digest.
245
+
Each entry in the array is a JSON object with the following members:
214
246
215
-
- The `algorithm` extension member is the algorithm key of the used hashing algorithm.
216
-
- The `provided-digest` extension member is 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}}.
217
-
- The `header` extension member as defined in {{identifying-problem-causing-headers}}.
247
+
- The `algorithm` member is a JSON string containing the algorithm key of the hashing algorithm.
248
+
- The `provided-digest` member is a JSON string containing 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}}.
249
+
- The `header` member is a JSON string containing the name of the integrity field that contained the mismatching digest value.
218
250
219
251
The problem type intentionally does not include the digest value calculated by the server to avoid attackers abusing this information for oracle attacks.
220
252
221
253
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.
222
254
223
-
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.
255
+
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 value.
{: title="Response indicating the mismatching digests"}
251
287
252
-
# Identifying Problem Causing Headers
253
-
254
-
Requests can include multiple integrity or integrity preference fields. For example, they may use the `Content-Digest` and `Repr-Digest` fields simultaneously or express preferences for content and representation digests at the same time. To aid troubleshooting, it's useful to identify the header field, whose value caused the problem detailed in the response. For this reason, the `header` extension member is defined, which SHOULD be populated for all responses using the problem types defined in this document.
255
-
256
-
The `header` extension member's value is the header field name that caused the problem. Since HTTP header field names are case-insensitive and not all HTTP versions preserve their casing, the casing of extension member's value might not match the request header field name's casing.
257
-
258
288
# Security Considerations
259
289
260
290
Disclosing error details could leak information
@@ -271,46 +301,46 @@ the calculated digest to avoid exposing information that can be abused for oracl
271
301
272
302
IANA is asked to register the following entries in the "HTTP Problem Types" registry at <https://www.iana.org/assignments/http-problem-types>.
273
303
274
-
## Registration of "digest-unsupported-algorithm" Problem Type
304
+
## Registration of "digest-unsupported-algorithms" Problem Type
0 commit comments