Skip to content

Commit 06bf629

Browse files
authored
Merge pull request #9 from jayadebaj/patch-1
Update draft-ietf-httpapi-idempotency-key-header.md
2 parents 44b6cff + 677d97b commit 06bf629

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

draft-ietf-httpapi-idempotency-key-header.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ For each request, server SHOULD
123123

124124
## Idempotency Enforcement Scenarios
125125

126-
* First time request (idempotency key or fingerprint has not been seen)
126+
* First time request (idempotency key and fingerprint has not been seen)
127127

128128
The resource server SHOULD process the request normally and respond with an appropriate response and status code.
129129

130-
* Duplicate request (idempotency key or fingerprint has been seen)
130+
* Duplicate request (idempotency key and fingerprint has been seen)
131131

132132
Retry
133133

134-
The request was retried after the original request completed. The resource server MUST respond with the result of the previously completed operation, success or an error.
134+
The request was retried after the original request completed. The resource server SHOULD respond with the result of the previously completed operation, success or an error. See Error Scenarios for details on errors.
135135

136136
Concurrent Request
137137

@@ -158,8 +158,9 @@ If the request is retried, while the original request is still being processed,
158158
Link: <https://developer.example.com/idempotency>;
159159
rel="describedby"; type="text/html"
160160

161-
For other errors, the resource MUST return the appropriate status code and error message.
161+
Error scenarios above describe the status of failed idempotent requests, after the resource server prcocesses them. Clients MUST correct the requests before performing a retry operation, or the the resource server MUST fail the request and return one of the above errors.
162162

163+
For other 4xx/5xx errors, such as 401, 403, 500, 502, 503, 504, 429, or any other HTTP error code that is not listed here, the client SHOULD act appropriately by following the resource server's documentation.
163164

164165

165166
# IANA Considerations
@@ -302,8 +303,16 @@ Organization: WebEngage
302303
This section is meant to inform developers, information providers,
303304
and users of known security concerns specific to the idempotency keys.
304305

305-
For idempotent request handling, the resources MAY make use of the value in the idempotency key to look up a cache or a persistent store for duplicate requests matching the key. If the resource does not validate the value of the idempotency key prior to performing such a lookup, it MAY lead to various forms of security attacks and compromise. To avoid such situations, the resource SHOULD publish the expected format of the idempotency key, algorithm used to generate it and always validate the key value as per the published specification before processing any request.
306+
Resource servers that do not implement strong idempotency keys, such as UUIDs, or have appropriate controls to validate the idempotency keys, could be victim to various forms of security attacks from malicious clients:
306307

308+
* Injection attacks-When the resource server does not validate the idempotency key in the client request and performs a idempotent cache lookup, there can be security attacks (primarily in the form of injection), compromising the server.
309+
* Data leaks-When an idempotency implementation allows low entropy keys, attackers MAY determine other keys and use them to fetch existing idempotent cache entries, belonging to other clients.
310+
311+
To prevent such situations, the specification recommends the following best practices for idempotency key implementation in the resource server.
312+
313+
* Establish a fixed format for the idempotency key and publish the key’s specification.
314+
* Always validate the key as per its published specification before processing any request.
315+
* On the resource server, implement a unique composite key as the idempotent cache lookup key. For example, a composite key MAY be implemented by combining the idempotency key sent by the client with other client specific attributes known only to the resource server.
307316

308317

309318
# Examples

0 commit comments

Comments
 (0)