[Feature] Use the nonce parameter in OIDC authorization request to mitigate replay attacks #871

Closed
opened 2025-12-29 02:25:05 +01:00 by adam · 1 comment
Owner

Originally created by @jirutka on GitHub (Dec 10, 2024).

Use case

The nonce parameter is used to mitigate replay attacks. It’s not required by the OpenID Connect Core specification, but it’s required by some OIDC/OAuth profiles, e.g. Financial-grade API Security Profile 1.0 and FAPI 2.0 Security Profile.

Description

OpenID Connect Core 1.0 – 3.1.2.1 Authentication Request:

nonce String value used to associate a Client session with an ID Token, and to mitigate replay attacks. The value is passed through unmodified from the Authentication Request to the ID Token. Sufficient entropy MUST be present in the nonce values used to prevent attackers from guessing values. For implementation notes, see Section 15.5.2.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

No response

Originally created by @jirutka on GitHub (Dec 10, 2024). ### Use case The `nonce` parameter is used to mitigate replay attacks. It’s not required by the OpenID Connect Core specification, but it’s required by some OIDC/OAuth profiles, e.g. [Financial-grade API Security Profile 1.0](https://openid.net/specs/openid-financial-api-part-1-1_0.html) and [FAPI 2.0 Security Profile](https://openid.net/specs/fapi-2_0-security-profile-ID2.html). ### Description [OpenID Connect Core 1.0 – 3.1.2.1 Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest): > `nonce` String value used to associate a Client session with an ID Token, and **to mitigate replay attacks.** The value is passed through unmodified from the Authentication Request to the ID Token. Sufficient entropy MUST be present in the nonce values used to prevent attackers from guessing values. For implementation notes, see [Section 15.5.2](https://openid.net/specs/openid-connect-core-1_0.html#NonceNotes). ### Contribution - [ ] I can write the design doc for this feature - [ ] I can contribute this feature ### How can it be implemented? _No response_
adam added the enhancementOIDC labels 2025-12-29 02:25:05 +01:00
adam closed this issue 2025-12-29 02:25:06 +01:00
Author
Owner

@kradalby commented on GitHub (Dec 11, 2024):

There is a PR open for PCKE, which I think is to cover MitM and not replay, is this somehow related still? https://github.com/juanfont/headscale/pull/1812

Any references to how others implement this in go would also be appreciated as reading spec and reversing it is very time consuming.

@kradalby commented on GitHub (Dec 11, 2024): There is a PR open for PCKE, which I think is to cover MitM and not replay, is this somehow related still? https://github.com/juanfont/headscale/pull/1812 Any references to how others implement this in go would also be appreciated as reading spec and reversing it is very time consuming.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#871