-
Notifications
You must be signed in to change notification settings - Fork 0
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
unchecked loop increments no valid in solidity > v0.8.22
#38
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
G (Gas Optimization)
G-12
grade-b
insufficient quality report
This report is not of sufficient quality
primary issue
Highest quality submission among a set of duplicates
Comments
c4-bot-7
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
labels
Mar 19, 2024
c4-pre-sort
added
the
insufficient quality report
This report is not of sufficient quality
label
Mar 22, 2024
raymondfam marked the issue as insufficient quality report |
raymondfam marked the issue as primary issue |
c4-pre-sort
added
the
primary issue
Highest quality submission among a set of duplicates
label
Mar 22, 2024
It's meant for gas optimization. |
The lookout made a good point. |
3docSec changed the severity to G (Gas Optimization) |
c4-judge
added
downgraded by judge
Judge downgraded the risk level of this issue
G (Gas Optimization)
and removed
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
labels
Mar 27, 2024
3docSec marked the issue as grade-b |
stevieraykatz
added a commit
to coinbase/smart-wallet
that referenced
this issue
Apr 3, 2024
stevieraykatz
added a commit
to coinbase/smart-wallet
that referenced
this issue
Apr 4, 2024
* Leverage solidity overflow check optimization for loop index increment. code-423n4/2024-03-coinbase-findings#38 * Cache storage var for use in loop, update once at the end. Per code-423n4/2024-03-coinbase-findings#195, G-01 * Cache storage pointer and reference in intialization. Per code-423n4/2024-03-coinbase-findings#195, G-02 * Remove no-op assigning of default value. Per code-423n4/2024-03-coinbase-findings#195 G-09 * Add new gas snapshot * Revert erc1271 change * Rerun snapshot * Remove _addOwner method and call _addOwnerAtIndex directly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
G (Gas Optimization)
G-12
grade-b
insufficient quality report
This report is not of sufficient quality
primary issue
Highest quality submission among a set of duplicates
Lines of code
https://github.com/code-423n4/2024-03-coinbase/blob/e0573369b865d47fed778de00a7b6df65ab1744e/src/SmartWallet/CoinbaseSmartWallet.sol#L208-L210
Vulnerability details
Impact
The new optimization in v0.8.22 removes the need for poor unchecked increment patterns in for loop bodies such
Proof of Concept
Solidity 0.8.22 introduces an overflow check optimization that automatically generates an unchecked arithmetic increment of the counter of for loops.
Tools Used
manual
Recommended Mitigation Steps
do not use
++i
in>v0.8.22
Assessed type
Other
The text was updated successfully, but these errors were encountered: