Skip to content

Commit 1c971b2

Browse files
authored
Add invalid_tx_code error code to pre-authz code flow (#686)
3 approvals. open for more than a week. discussed in the dcp wg call. merging
1 parent 7513ad8 commit 1c971b2

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

1.0/openid-4-verifiable-credential-issuance-1_0.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1503,6 +1503,17 @@ An attacker might leverage the Credential issuance process and the End-User's tr
15031503

15041504
In order to cope with that issue, the Wallet is RECOMMENDED to interact with trusted Credential Issuers only. In that case, the Wallet would not process a Credential Offer with an untrusted issuer URL. The Wallet MAY also show the End-User the endpoint of the Credential Issuer it will be sending the Transaction Code to and ask the End-User for confirmation.
15051505

1506+
### Transaction Code Guessing
1507+
1508+
When the Pre-Authorized Code Flow is used together with a Transaction Code (`tx_code`), the Transaction Code is typically short, low-entropy, and intended for one-time use. As a result, it may be susceptible to online guessing or brute-force attacks if an attacker can repeatedly submit Token Requests using the same Pre-Authorized Code.
1509+
1510+
To mitigate this risk, the Authorization Server SHOULD limit the number of failed Transaction Code verification attempts associated with a Pre-Authorized Code or issuance transaction. Once a configurable maximum number of failed attempts is exceeded, the Authorization Server SHOULD invalidate the Pre-Authorized Code and reject further Token Requests for that transaction.
1511+
1512+
Transaction Codes SHOULD be short-lived and SHOULD be treated as single-use. Upon successful verification, a Transaction Code SHOULD NOT be accepted again.
1513+
1514+
When a valid Pre-Authorized Code is presented with an incorrect Transaction Code, the Authorization Server SHOULD return an error indicating that the provided Transaction Code is invalid.
1515+
If the Pre-Authorized Code has expired, has been invalidated (including due to too many failed attempts), or is otherwise no longer valid, the Authorization Server SHOULD return the `invalid_grant` error.
1516+
15061517
## Credential Lifecycle Management
15071518

15081519
The Credential Issuer is supposed to be responsible for the lifecycle of its Credentials. This means the Credential Issuer will invalidate Credentials when it deems appropriate, e.g., if it detects fraudulent behavior.
@@ -3026,7 +3037,7 @@ The technology described in this specification was made available from contribut
30263037

30273038
-19
30283039

3029-
* TBD
3040+
* Add security consideration on transaction code guessing
30303041

30313042
-final
30323043

1.1/openid-4-verifiable-credential-issuance-1_1.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,13 +1167,16 @@ The following additional clarifications are provided for some of the error codes
11671167

11681168
`invalid_grant`:
11691169

1170-
- The Authorization Server expects a Transaction Code in the Pre-Authorized Code Flow but the Client provides the wrong Transaction Code.
1171-
- The End-User provides the wrong Pre-Authorized Code or the Pre-Authorized Code has expired.
1170+
- The End-User provides the wrong Pre-Authorized Code or the Pre-Authorized Code has expired or is no longer valid.
11721171

11731172
`invalid_client`:
11741173

11751174
- The Client tried to send a Token Request with a Pre-Authorized Code without a Client ID but the Authorization Server does not support anonymous access.
11761175

1176+
`invalid_tx_code`:
1177+
1178+
- The Authorization Server expects a Transaction Code in the Pre-Authorized Code Flow but the Client provides the wrong Transaction Code.
1179+
11771180
Below is a non-normative example of a Token Error Response:
11781181

11791182
```
@@ -1928,6 +1931,16 @@ An attacker might leverage the Credential issuance process and the End-User's tr
19281931

19291932
In order to cope with that issue, the Wallet is RECOMMENDED to interact with trusted Credential Issuers only. In that case, the Wallet would not process a Credential Offer with an untrusted issuer URL. The Wallet MAY also show the End-User the endpoint of the Credential Issuer it will be sending the Transaction Code to and ask the End-User for confirmation.
19301933

1934+
### Transaction Code Guessing
1935+
1936+
When the Pre-Authorized Code Flow is used together with a Transaction Code (`tx_code`), the Transaction Code is typically short, low-entropy, and intended for one-time use. As a result, it may be susceptible to online guessing or brute-force attacks if an attacker can repeatedly submit Token Requests using the same Pre-Authorized Code.
1937+
1938+
To mitigate this risk, the Authorization Server SHOULD limit the number of failed Transaction Code verification attempts associated with a Pre-Authorized Code or issuance transaction. Once a configurable maximum number of failed attempts is exceeded, the Authorization Server SHOULD invalidate the Pre-Authorized Code and reject further Token Requests for that transaction.
1939+
1940+
Transaction Codes SHOULD be short-lived and SHOULD be treated as single-use. Upon successful verification, a Transaction Code SHOULD NOT be accepted again.
1941+
1942+
When a valid Pre-Authorized Code is presented with an incorrect Transaction Code, the Authorization Server SHOULD return the `invalid_tx_code` error. If the Pre-Authorized Code has expired, has been invalidated (including due to too many failed attempts), or is otherwise no longer valid, the Authorization Server SHOULD return the `invalid_grant` error.
1943+
19311944
## Credential Lifecycle Management
19321945

19331946
The Credential Issuer is supposed to be responsible for the lifecycle of its Credentials. This means the Credential Issuer will invalidate Credentials when it deems appropriate, e.g., if it detects fraudulent behavior.
@@ -3672,5 +3685,6 @@ The technology described in this specification was made available from contribut
36723685
* use derived origin for `expected_origins` in IAE flow
36733686
* add require_interactive_authorization_request to AS metadata
36743687
* add interactive_authorization_endpoint to AS metadata section
3688+
* add invalid_tx_code to Pre-Authz Code Flow
36753689
* add URNs for IAE type identifiers
36763690
* add iana registration for an openid foundation urn

0 commit comments

Comments
 (0)