Skip to content

Assert claim.subject==linkingKey, for jwt. #37

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

Open
G8XSU opened this issue Mar 27, 2025 · 3 comments
Open

Assert claim.subject==linkingKey, for jwt. #37

G8XSU opened this issue Mar 27, 2025 · 3 comments

Comments

@G8XSU
Copy link
Collaborator

G8XSU commented Mar 27, 2025

Refer: #26 (comment)

Since VSS uses claim.subject as the user identity, I still think the client should verify that it matches the linkingKey.

Otherwise, if the auth-server—intentionally or unintentionally—returns a different claim.subject, the client could end up reading or writing data against a different key.
Even if the data is encrypted on the client side, this could still increase the risk of unintended exposure.

@G8XSU
Copy link
Collaborator Author

G8XSU commented Mar 27, 2025

@tnull @wvanlint
What do you think?

@tnull
Copy link
Contributor

tnull commented Mar 28, 2025

AFAICT it would make sense, although I'm not sure if @wvanlint had some alternative use cases in mind when he decided against this in the referenced discussion.

@wvanlint
Copy link
Contributor

I think I was mainly wondering there whether that's an implementation detail - the only required invariant could be that the same authentication identity maps one-to-one to the same JWT subject.

Perhaps allowing any type of subject could be useful to support multiple authentication methods and decouple the VSS namespacing from the LNURL Auth linking key.

Otherwise, if the auth-server—intentionally or unintentionally—returns a different claim.subject, the client could end up reading or writing data against a different key.
Even if the data is encrypted on the client side, this could still increase the risk of unintended exposure.

Wouldn't assuming that the authentication server is malicious/broken have additional consequences as well?

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

3 participants