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: disallow deser for strings that are too long #229

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

Rjected
Copy link
Contributor

@Rjected Rjected commented Mar 30, 2023

Motivation

paradigmxyz/reth#1784 highlighted that deserialization allows strings that are too long, for example 0x000 would be successfully deserialized for a single-byte Uint.

Solution

Ensure that the input string to deserialize is not longer than 2 times the max number of bytes.

Added tests for max value (0xffff...) inputs and zero value (0x0000...) inputs.

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@Rjected Rjected requested a review from recmo as a code owner March 30, 2023 21:27
@recmo
Copy link
Owner

recmo commented Apr 19, 2023

I'll fix CI errors and merge.

@recmo
Copy link
Owner

recmo commented Apr 19, 2023

Can't push pr. Will fix in main.

@recmo recmo merged commit 10b109b into recmo:main Apr 19, 2023
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.

2 participants