-
Notifications
You must be signed in to change notification settings - Fork 10
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
🔒 M-03 - Add Authorization Control to Fallback Function #120
Conversation
🤖 Slither Analysis Report 🔎Slither report
# Slither report
_This comment was automatically generated by the GitHub Actions workflow._
THIS CHECKLIST IS NOT COMPLETE. Use
constable-statesImpact: Optimization
|
Changes to gas cost
🧾 Summary (5% most significant diffs)
Full diff report 👇
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fix/security-m01 #120 +/- ##
===================================================
Coverage ? 71.73%
===================================================
Files ? 13
Lines ? 697
Branches ? 133
===================================================
Hits ? 500
Misses ? 197
Partials ? 0
Continue to review full report in Codecov by Sentry.
|
@@ -137,15 +138,22 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra | |||
function executeFromExecutor( | |||
ExecutionMode mode, | |||
bytes calldata executionCalldata | |||
) external payable onlyExecutorModule withHook withRegistry(msg.sender, MODULE_TYPE_EXECUTOR) returns (bytes[] memory returnData) { | |||
) |
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.
can we not touch linting as far as this PR goes?
@@ -23,14 +25,10 @@ import { IBaseAccount } from "../interfaces/base/IBaseAccount.sol"; | |||
/// @author @filmakarov | Biconomy | [email protected] | |||
/// @author @zeroknots | Rhinestone.wtf | zeroknots.eth | |||
/// Special thanks to the Solady team for foundational contributions: https://github.com/Vectorized/solady | |||
contract BaseAccount is IBaseAccount { | |||
contract BaseAccount is Storage, IBaseAccount { |
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.
??
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.
I moved the _ENTRYPOINT to storage, as it needs to be used by both BaseAccount and ModuleManager for the new onlyAuthorized
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.
why would you do that?
it's not a storage
it's immutable : address internal immutable _ENTRYPOINT;
what's new onlyAuthorized for?
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.
onlyAuthorized is checking msg.sender is EP, self or Executor while other modifier are exclusively checking EP EP+self or Executor only
if the naming is a problem we can change it
what is done specific to this?
I don't see changes related to it. we also discussed fallback handler should implement it's own auth control and we are gonna make changes on the EIP PR. cc @filmakarov can you close this PR and redo it if only there are additional test cases. bunch of linting makes it very hard to review.. |
Should this be a remediation for this https://codehawks.cyfrin.io/c/2024-07-biconomy/s/179 ? |
No, anyone should be able to invoke fallback handlers. |
At this point, the entrypoint and the onlyEntrypoint or onlySelfOrEntrypoint are not visible, any suggestion? Yes my husky script messed a bit with the linter |
dont think any of this change makes sense. |
then close the PR |
M-03. Anyone can call the fallbackFunction because of missing authorization control
fallback
function inModuleManager
.