Skip to content

fix: block undeclared state-diff changes from matching (SECBUGS-24878) - #191

Merged
0xth4nh merged 6 commits into
mainfrom
fix/undeclared-state-diff-changes
Aug 20, 2026
Merged

fix: block undeclared state-diff changes from matching (SECBUGS-24878)#191
0xth4nh merged 6 commits into
mainfrom
fix/undeclared-state-diff-changes

Conversation

@0xth4nh

@0xth4nh 0xth4nh commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pair expected vs actual state overrides, changes, and balances by (address, slot/field) instead of array index, so extra simulation results cannot be dropped.
  • Surface undeclared actual entries as blocking unexpected rows (hasBlockingErrors() returns true). Duplicate identities stay on the review screen as blocking unexpected/missing rows.
  • Hex keys and values compare case-insensitively, and case-only differences are not highlighted on a match.

Fixes SECBUGS-24878. Fixes H1#3945949.

Test plan

  • npm test -- src/lib/__tests__/validation-results-utils.test.ts (match, declared mismatch, undeclared extras, reorder, duplicates, case-insensitive hex)
  • npm test
  • npm run lint
  • npm run build

Pair expected vs actual state overrides, changes, and balances by address and slot instead of array index, and fail validation when the simulation produces results the task config did not declare.

Co-Authored-By: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
@cb-heimdall

cb-heimdall commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

0xth4nh and others added 2 commits August 18, 2026 13:48
Pair by Map get/delete instead of duplicate-key buckets, and fail validation with a direct identity-set check instead of rebuilding comparison rows.

Co-Authored-By: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
Drop match/mismatch/UI coverage; those paths were already blocked or are not the H1 hole.

Co-Authored-By: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
Comment thread src/lib/validation-results-utils.ts Outdated
Comment thread src/lib/validation-results-utils.ts Outdated
Comment thread src/lib/validation-results-utils.ts
Comment thread src/lib/validation-service.ts Outdated
Comment thread src/lib/validation-service.ts Outdated
Drop the service throw so signers see unexpected rows, fail pairing when an address and slot appear twice, and compare storage keys case-insensitively.

Co-authored-by: Cursor <[email protected]>
Comment thread src/lib/validation-results-utils.ts
Comment thread src/lib/validation-results-utils.ts
Comment thread src/lib/__tests__/validation-results-utils.test.ts
Emit extra address/slot rows as blocking mismatches instead of throwing in render, compare hex values case-insensitively, and cover overrides, balances, and declared mismatches in tests.

Co-authored-by: Cursor <[email protected]>
Comment thread src/lib/validation-results-utils.ts
Skip display diffs when identity comparison already treats the values as a match, so a green match is not contradicted by removed/added highlights.

Co-authored-by: Cursor <[email protected]>
@0xth4nh 0xth4nh changed the title fix: block undeclared state-diff changes from matching fix: block undeclared state-diff changes from matching (SECBUGS-24878) Aug 20, 2026
@0xth4nh
0xth4nh merged commit e87c180 into main Aug 20, 2026
6 checks passed
@0xth4nh
0xth4nh deleted the fix/undeclared-state-diff-changes branch August 20, 2026 19:30
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.

3 participants