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: check length of public key after decoding #1115
Conversation
🦋 Changeset detectedLatest commit: 435d19d The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thank you @isoldo for the contribution!
I have one minor comment inline but it's not a blocker. Let me know what you think but either way we'll get this into the next release.
Co-authored-by: andy-haynes <36863574+andy-haynes@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @isoldo!
Pre-flight checklist
pnpm changeset
to create achangeset
JSON document appropriate for this change.Motivation
Used
PublicKey.fromString()
as a validator for user input. As it turns out, the function doesn't check for length of the decoded public key.Test Plan
Call
PublicKey.fromString(baseEncode(publicKey))
withpublicKey
being a string with less than 32 characters - the function throws an error.Related issues/PRs
#1114