-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [CL ALCHEMY-001] validation applicability check in deferred action #278
base: develop
Are you sure you want to change the base?
fix: [CL ALCHEMY-001] validation applicability check in deferred action #278
Conversation
Summary by OctaneNew ContractsNo new contracts were added in this PR. Updated Contracts
🔗 Commit Hash: dcac37f |
Contract sizes: | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
|-------------------------------|------------------|-------------------|--------------------|---------------------|
| AccountFactory | 4,814 | 5,239 | 19,762 | 43,913 |
| AllowlistModule | 9,903 | 9,930 | 14,673 | 39,222 |
| ExecutionInstallDelegate | 5,714 | 5,760 | 18,862 | 43,392 |
-| ModularAccount | 21,973 | 28,676 | 2,603 | 20,476 |
+| ModularAccount | 21,931 | 28,634 | 2,645 | 20,518 |
| NativeFunctionDelegate | 434 | 461 | 24,142 | 48,691 |
| NativeTokenLimitModule | 4,449 | 4,476 | 20,127 | 44,676 |
| PaymasterGuardModule | 1,845 | 1,872 | 22,731 | 47,280 |
-| SemiModularAccountBytecode | 23,275 | 29,978 | 1,301 | 19,174 |
-| SemiModularAccountStorageOnly | 23,769 | 30,472 | 807 | 18,680 |
+| SemiModularAccountBytecode | 23,233 | 29,936 | 1,343 | 19,216 |
+| SemiModularAccountStorageOnly | 23,727 | 30,430 | 849 | 18,722 |
| SingleSignerValidationModule | 3,646 | 3,673 | 20,930 | 45,479 |
| TimeRangeModule | 2,000 | 2,027 | 22,576 | 47,125 |
| WebAuthnValidationModule | 7,854 | 7,881 | 16,722 | 41,271 | Code coverage:
|
OverviewOctane AI analysis has finished. No vulnerabilities were found. Cheers! 🎉🎉🎉 🔗 Commit Hash: dcac37f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but would recommend waiting for another approval
generally, since sig val can be used to execute arbitrary actions on the account via deferred actions, isSignatureValidation is a very risky permission that should be controlled very tightly right?
8c57cdc
to
dcac37f
Compare
Motivation
Addresses CL ALCHEMY-001.
In
_validateDeferredActionAndSetNonce
, the incorrect validation applicability checking function was used, which only verified the selector, rather than considering the allowed pattern of batching using self-calls.Note that we can't adopt the suggested remediation due to the requirement of supporting calls to
approve
on token contracts during a user op with initcode. See this test file for a sample case: https://github.com/alchemyplatform/modular-account/blob/develop/test/account/DeferredAction.t.sol#L61.Solution
Update the deferred action checking logic to use
_checkIfValidationAppliesCallData
, which performs the necessary checks over self-calls.Also add a test verifying that the validation applicability check for self-calls is enforced.