fix: Stale schema hash lets EIP-712 metadata signatures apply to a different schema#989
Closed
cerberus-production[bot] wants to merge 1 commit into
Closed
fix: Stale schema hash lets EIP-712 metadata signatures apply to a different schema#989cerberus-production[bot] wants to merge 1 commit into
cerberus-production[bot] wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #989 +/- ##
========================================
Coverage 55.02% 55.02%
========================================
Files 16 16
Lines 1592 1592
Branches 201 201
========================================
Hits 876 876
- Misses 708 712 +4
+ Partials 8 4 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Closing, because covered by #1031 |
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.
Closes #988
Summary
Automated security fix for Stale schema hash lets EIP-712 metadata signatures apply to a different schema (High).
CWE: CWE-CWE-345
OWASP: A08:2021-Software and Data Integrity Failures
Fix Confidence: high
What Changed
The vulnerability allows an attacker to modify the EIP-712 schema after the schema hash has been computed during P2_FILT_ACTIVATE, because struct_state remains INITIALIZED (not DEFINED) and handle_eip712_struct_def() only rejects definitions when struct_state == DEFINED.
The fix adds
struct_state = DEFINED;immediately after the schema hash computation in the P2_FILT_ACTIVATE handler. This locks the schema by preventing any further struct name or field definitions from being accepted (since handle_eip712_struct_def checksif (struct_state == DEFINED) { ret = false; }). The assignment is placed after the if-block so it applies regardless of verbose_eip712 setting, ensuring the schema is always locked when filtering is activated.This is a single-line addition that closes the window between schema hash computation and schema lockdown.
Caveats
Verification Checklist
Created by Cerberus Merlin