Skip to content

fix(jwk): add validation for jwks#224

Open
atticusofsparta wants to merge 1 commit intoArweaveTeam:masterfrom
atticusofsparta:master
Open

fix(jwk): add validation for jwks#224
atticusofsparta wants to merge 1 commit intoArweaveTeam:masterfrom
atticusofsparta:master

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