Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect the nonce endpoint #461

Open
andprian opened this issue Feb 17, 2025 · 5 comments
Open

Protect the nonce endpoint #461

andprian opened this issue Feb 17, 2025 · 5 comments

Comments

@andprian
Copy link

Having this endpoint unprotected is not a good idea:

  • If the Issuer returns the same nonce every time this makes the nonce publicly available to anyone, which makes it completely useless. Moreover, clause 7.2 states that "This value MUST be unpredictable." so I am not sure if it is therefore required to have a new nonce with every call.
  • If the Issuer returns a different nonce with every call this makes it an attack vector because the nonce database would grow continuously and the service could be vulnerable to a DoS. This would also make it difficult to search for a nonce when receiving it in the credential request.

This endpoint should be protected with the access token that the wallet just obtained, just like the credential endpoint. Thus, the nonce would be also linked to a specific wallet which would make it simple for the Issuer to match the nonce when receiving it in the subsequent credential request.

Also, it would make more sense for this endpoint to implement a GET method instead of a POST.

@c2bo
Copy link
Member

c2bo commented Feb 17, 2025

There was some discussion on this in the prior issue/PR: #404

@bc-pi
Copy link
Member

bc-pi commented Feb 17, 2025

Also some discussion in #381 - in particular this part #381 (comment) about GET vs POST and #381 (comment) on protection of the endpoint.

@oriolcanades
Copy link

oriolcanades commented Feb 19, 2025

My 2 cents. I checked the comments in #381 and the current OID4VCI draft. If the only way to use a nonce endpoint—where a fresh c_nonce value can be obtained—is for proof of possession of key material in a subsequent request to the Credential Endpoint, and this call is always made after the Token request, then why don’t we secure the nonce endpoint? Are there other use cases where we need a nonce before acquiring the Token?

@andprian
Copy link
Author

@oriolcanades I do not see the need to ask for a nonce if you don't have a previously obtained access token.

@Fethbita
Copy link

Fethbita commented Mar 5, 2025

I also agree that the nonce endpoint must be protected. What was this WG (#381 (comment)) discussion about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants