Skip to content

fix: Reject oversized memo hex strings before decoding in z_sendmany#464

Open
ouicate wants to merge 1 commit into
zcash:mainfrom
ouicate:fix-parse-memo-unbounded-hex-dos
Open

fix: Reject oversized memo hex strings before decoding in z_sendmany#464
ouicate wants to merge 1 commit into
zcash:mainfrom
ouicate:fix-parse-memo-unbounded-hex-dos

Conversation

@ouicate

@ouicate ouicate commented Jun 10, 2026

Copy link
Copy Markdown

Summary

  • Confirms and fixes a real DoS in parse_memo: hex::decode allocated up to memo_hex.len() / 2 bytes before MemoBytes::from_bytes enforced the 512-byte limit.
  • Rejects memo hex strings longer than 1024 characters (512 decoded bytes) before calling hex::decode, matching the existing RPC error message.
  • Adds unit tests covering max-length acceptance, overlong rejection, and invalid hex.

Related security advisory: GHSA-9w94-x964-rgxq

`hex::decode` allocates decoded bytes before `MemoBytes::from_bytes`
enforces the 512-byte limit, so an authenticated RPC caller could
trigger unbounded heap allocation via `z_sendmany`'s memo field.

Co-Authored-By: Composer <noreply@cursor.com>
@ouicate ouicate changed the title Reject oversized memo hex strings before decoding in z_sendmany fix: Reject oversized memo hex strings before decoding in z_sendmany Jun 10, 2026
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.

1 participant