Skip to content

fix(platform-wallet): reject trailing bytes in persisted asset-lock proof blobs - #4346

Merged
QuantumExplorer merged 1 commit into
v4.2-devfrom
fix/asset-lock-proof-blob-trailing-bytes
Aug 8, 2026
Merged

fix(platform-wallet): reject trailing bytes in persisted asset-lock proof blobs#4346
QuantumExplorer merged 1 commit into
v4.2-devfrom
fix/asset-lock-proof-blob-trailing-bytes

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Aug 8, 2026

Copy link
Copy Markdown
Member

Follow-up to #4342, addressing the last CodeRabbit finding there (it was posted just before the merge): decode_from_slice stops at the value's end without rejecting trailing bytes, and the lifecycle_blob holds 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

  • Bug Fixes
    • Improved validation of asset-lock proofs by rejecting malformed data with unexpected trailing bytes.
    • Added safeguards to ensure proof data is fully and accurately processed.

…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>
@github-actions github-actions Bot added this to the v4.2.0 milestone Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a59ac1ff-b598-418a-b202-1f55f4327649

📥 Commits

Reviewing files that changed from the base of the PR and between 71402fa and 0eddfbd.

📒 Files selected for processing (1)
  • packages/rs-platform-wallet/src/changeset/serde_adapters.rs

📝 Walkthrough

Walkthrough

Asset-lock proof deserialization now rejects payloads with trailing bytes. Tests verify valid round-trips and failure for appended data.

Changes

Asset-lock proof validation

Layer / File(s) Summary
Strict proof decoding and validation tests
packages/rs-platform-wallet/src/changeset/serde_adapters.rs
Proof decoding checks that bincode consumes the full payload. Tests cover exact round-trips and proof blobs with appended bytes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: lklimek, llbartekll, shumkov, zocolini

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: rejecting trailing bytes in persisted asset-lock proof blobs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/asset-lock-proof-blob-trailing-bytes

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 2 ahead in queue (commit 0eddfbd)
Queue position: 3/3 · 1 review active
ETA: start ~21:25 UTC · complete ~21:41 UTC (median 15m across 30 recent reviews; 2 slots)
Queued 51s ago · Last checked: 2026-08-08 21:10 UTC

@QuantumExplorer
QuantumExplorer merged commit 98c5227 into v4.2-dev Aug 8, 2026
19 checks passed
@QuantumExplorer
QuantumExplorer deleted the fix/asset-lock-proof-blob-trailing-bytes branch August 8, 2026 21:11
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