Internet-Draft | HTTP Problem Types for Digest Fields | April 2025 |
Kleidl, et al. | Expires 27 October 2025 | [Page] |
This document specifies problem types that servers can use in responses to problems encountered while dealing with a request carrying integrity fields and integrity preference fields.¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://ietf-wg-httpapi.github.io/digest-fields-problem-types/draft-ietf-httpapi-digest-fields-problem-types.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-ietf-httpapi-digest-fields-problem-types/.¶
Discussion of this document takes place on the Building Blocks for HTTP APIs Working Group mailing list (mailto:httpapi@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/httpapi/. Subscribe at https://www.ietf.org/mailman/listinfo/httpapi/.¶
Source for this draft and an issue tracker can be found at https://github.com/ietf-wg-httpapi/digest-fields-problem-types.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 27 October 2025.¶
Copyright (c) 2025 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
[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.¶
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.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Some examples in this document contain long lines that may be folded, as described in [RFC8792].¶
The terms "integrity fields" and "integrity preference fields" in this document are to be interpreted as described in [DIGEST].¶
The term "problem type" in this document is to be interpreted as described in [PROBLEM].¶
The terms "request", "response", "intermediary", "sender", and "server" are from [HTTP].¶
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.¶
This section defines the "https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm" problem type. A server MAY use this problem type if it wants to communicate to the client that one of the hashing algorithms referenced in the integrity or integrity preference fields present in the request is not supported.¶
Two problem type extension members are defined, which SHOULD be populated for all responses using this problem type:¶
The unsupported-algorithm
extension member identifies the unsupported algorithm from the request. Its value is the corresponding algorithm key.¶
The response can include the corresponding integrity preference field to indicate the server's algorithm support and preference.¶
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.¶
Example:¶
This problem type can also be used when a request contains an integrity preference field with an unsupported algorithm. For example:¶
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.¶
One problem type extension member is defined, which SHOULD be populated for all responses using this problem type:¶
The server SHOULD include a human-readable description why the value is considered invalid in the title
member.¶
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.¶
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.¶
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.¶
Three problem type extension members are defined, which SHOULD be populated for all responses using this problem type:¶
The algorithm
extension member is the algorithm key of the used hashing algorithm.¶
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].¶
The problem type intentionally does not include the digest value calculated by the server to avoid attackers abusing this information for oracle attacks.¶
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.¶
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.¶
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.¶
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.¶
Disclosing error details could leak information such as the presence of intermediaries or the server's implementation details. Moreover, they can be used to fingerprint the server.¶
To mitigate these risks, a server could assess the risk of disclosing error details and prefer a general problem type over a more specific one.¶
When a server informs the client about mismatching digest values, it should not expose the calculated digest to avoid exposing information that can be abused for oracle attacks.¶
IANA is asked to register the following entries in the "HTTP Problem Types" registry at https://www.iana.org/assignments/http-problem-types.¶
https://iana.org/assignments/http-problem-types#digest-unsupported-algorithm¶
Unsupported Hashing Algorithm¶
400¶
Section 3.1 of this document¶
https://iana.org/assignments/http-problem-types#digest-invalid-value¶
Invalid Digest Value¶
400¶
Section 3.2 of this document¶
https://iana.org/assignments/http-problem-types#digest-mismatching-value¶
Mismatching Digest Value¶
400¶
Section 3.3 of this document¶