fix(platform-wallet): reject trailing bytes in persisted asset-lock proof blobs - #4346
Conversation
…roof blobs decode_from_slice stops at the value's end without rejecting trailing bytes; the lifecycle blob holds exactly one proof, so a longer payload is corruption, not a valid encoding. Regression test tampers a byte onto the proof bytes and asserts the decode fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAsset-lock proof deserialization now rejects payloads with trailing bytes. Tests verify valid round-trips and failure for appended data. ChangesAsset-lock proof validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
🕓 Ready for review — 2 ahead in queue (commit 0eddfbd) |
Follow-up to #4342, addressing the last CodeRabbit finding there (it was posted just before the merge):
decode_from_slicestops at the value's end without rejecting trailing bytes, and thelifecycle_blobholds exactly one proof — so a longer payload is corruption, not a valid encoding. The serde adapter now compares the consumed-byte count against the blob length and fails the decode with a typed serde error, with a regression test that appends a byte to the proof bytes and asserts rejection.🤖 Generated with Claude Code
Summary by CodeRabbit