Skip to content

Commit 68da2d7

Browse files
committed
Editorial touches
1 parent 03c9d55 commit 68da2d7

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

draft-ietf-httpapi-digest-fields-problem-types.md

+23-18
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This document specifies problem types that servers can use in responses to probl
5656

5757
# Introduction
5858

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.
6060

6161
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.
6262

@@ -87,7 +87,7 @@ interpreted as described in {{DIGEST}}.
8787
The term "problem type" in this document is to be
8888
interpreted as described in {{PROBLEM}}.
8989

90-
The term "request", "response", "intermediary", "sender", and "server" are from {{HTTP}}.
90+
The terms "request", "response", "intermediary", "sender", and "server" are from {{HTTP}}.
9191

9292
# Problem Types
9393

@@ -102,6 +102,10 @@ For this problem type, `unsupported-algorithm` is defined as the only extension
102102
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.
103103
The response can include the corresponding integrity preference field to indicate the server's algorithm support and preference.
104104

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.
108+
105109
Example:
106110

107111
~~~ http-message
@@ -130,21 +134,17 @@ Want-Repr-Digest: sha-512=10, sha-256=0
130134
"unsupported-algorithm": "sha-256"
131135
}
132136
~~~
133-
{: title="Response Advertising the Supported Algorithms"}
134-
137+
{: title="Response indicating the problem and advertising the supported algorithms"}
135138

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:
140140

141141
~~~ http-message
142142
GET /items/123 HTTP/1.1
143143
Host: foo.example
144144
Want-Repr-Digest: sha=10
145145

146146
~~~
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"}
148148

149149
~~~ http-message
150150
# NOTE: '\' line wrapping per RFC 8792
@@ -159,14 +159,16 @@ Content-Type: application/problem+json
159159
"unsupported-algorithm": "sha"
160160
}
161161
~~~
162-
{: title="Response Advertising the Supported Algorithms"}
162+
{: title="Response indicating the problem and advertising the supported algorithms"}
163163

164164
## Invalid Digest Value
165165

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.
167167

168168
The server SHOULD include a human-readable description why the value is considered invalid in the `title` member.
169169

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+
170172
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.
171173

172174
~~~ http-message
@@ -177,7 +179,7 @@ Repr-Digest: sha-512=:YMAam51Jz/jOATT6/zvHrLVgOYTGFy1d6GJiOHTohq4:
177179

178180
{"hello": "world"}
179181
~~~
180-
{: title="A request with a sha-512 integrity field, whose digest has been truncated"}
182+
{: title="A request with a sha-512 integrity field, whose digest has been truncated to 32 bytes"}
181183

182184
~~~ http-message
183185
# NOTE: '\' line wrapping per RFC 8792
@@ -193,13 +195,15 @@ Content-Type: application/problem+json
193195
~~~
194196
{: title="Response indicating that the provided digest is too short"}
195197

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-
198198
## Mismatching Digest Value
199199

200200
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.
201201

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.
203207

204208
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.
205209

@@ -211,7 +215,7 @@ Repr-Digest: sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=:
211215

212216
{"hello": "woXYZ"}
213217
~~~
214-
{: title="A request with a sha-256 integrity field, which does not match the representation"}
218+
{: title="A request with a sha-256 integrity field, which does not belong to the representation"}
215219

216220
~~~ http-message
217221
# NOTE: '\' line wrapping per RFC 8792
@@ -229,8 +233,6 @@ Content-Type: application/problem+json
229233
~~~
230234
{: title="Response indicating the mismatching digests"}
231235

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-
234236
# Security Considerations
235237

236238
Disclosing error details could leak information
@@ -240,6 +242,9 @@ Moreover, they can be used to fingerprint the server.
240242
To mitigate these risks, a server could assess the risk of disclosing error details
241243
and prefer a general problem type over a more specific one.
242244

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+
243248
# IANA Considerations
244249

245250
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

Comments
 (0)