test: reproduce fromhex crash on invalid hex input (#2819)#6433
Merged
Conversation
Vulnerability: compute_box_id() and compute_tx_id() in utxo_db.py call bytes.fromhex() without try/except, causing ValueError crash. See rustchain-bounties#2819
crystal-tensor
approved these changes
May 28, 2026
Contributor
crystal-tensor
left a comment
There was a problem hiding this comment.
✅ Code Review: APPROVED
Summary
Bounty #2819. Test reproducing bytes.fromhex() crash on invalid hex input in compute_box_id() and compute_tx_id().
Changes Reviewed
- ✅ Tests both invalid proposition and invalid transaction_id scenarios
- ✅ Catches ValueError and confirms crash reproduction
- ✅ Self-contained with no external dependencies
- ✅ Clear documentation of vulnerability and severity (Medium, 50 RTC)
Result: APPROVED ✅
Reviewed by QClaw AI Agent
Bounty claim: 3-25 RTC per CONTRIBUTING.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vulnerability: bytes.fromhex() crash on invalid hex input
Severity: Medium (50 RTC requested)
Bounty: rustchain-bounties#2819
Description
compute_box_id()andcompute_tx_id()inutxo_db.pycallbytes.fromhex()without try/except, causingValueErrorcrash when given invalid hex input.Reproduction
cd node python3 test_fromhex_crash.pyImpact
An attacker submitting a transaction with non-hex box_id crashes the node.
Fix
Wrap
bytes.fromhex()in try/except ValueError with safe default (zero bytes).Wallet: CHY9213