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

fix(jwk): add validation for jwks #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atticusofsparta
Copy link

Ran into an issue across multiple apps that pull in the jwk and create an address with invalid jwk.n keys.

This validates the JWK by verifying the signature when signing transactions and when generating a wallet address. Should help prevent people accidentally sending tokens to their wallet when onboarding (as is what happend to me)

@rosmcmahon
Copy link
Member

not going to merge this straight away.

  • arweave-js needs a little TLC. even the automated tests are still running nodejs v16.
    • they don't pass with current LTS v20.
  • the sign + validate for every createTransaction is kind of expensive
  • there were some folks using valid 2048 length keys,
    • personally i think that should not have been allowed, but would have to check if that's still occurring in mined blocks
  • perhaps we could add some other fast jwk validation steps?

@rosmcmahon rosmcmahon linked an issue Mar 16, 2024 that may be closed by this pull request
@atticusofsparta
Copy link
Author

Agreed, ideally the validateJWK implements checked based on the spec (byte length and regex check).

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

Successfully merging this pull request may close these issues.

BUG[fix]: JWK validation improvements
2 participants