Closed c4-bot-5 closed 11 months ago
raymondfam marked the issue as insufficient quality report
raymondfam marked the issue as duplicate of #46
raymondfam marked the issue as not a duplicate
raymondfam marked the issue as sufficient quality report
Code and comment mismatch. Probably inconsequential.
raymondfam marked the issue as insufficient quality report
0xA5DF changed the severity to QA (Quality Assurance)
Seems like a valid low, no significant impact was demonstrated
0xA5DF marked the issue as grade-c
Low quantity, this is the only QA by the warden
The above submission does point out the issue although the impact described in relation with CurveTricryptoAdapter.sol is incorrect.
However, the incorrect calculated id still posses an issue.
The above described issue shows an invariant being partially broken.
- Fees should be credited to the Ocean owner's ERC-1155 balance
Although the fees is being to the owner, it is sent to the incorrect Ocean ID because of wrong address used inside the constructor while calculating the WRAPPED_ETHER_ID
.
The correct WRAPPED_ETHER_ID
should have been calculated as follows
File: Ocean.sol
173: WRAPPED_ETHER_ID = _calculateOceanId(address(0x7368455448), 0); // hexadecimal(ascii("shETH")) /// @correct
& not as
File: Ocean.sol
173: WRAPPED_ETHER_ID = _calculateOceanId(address(0x4574686572), 0); // hexadecimal(ascii("Ether")) /// @incorrect
Because an invariant is being broken, the submission should be a Medium.
Because an invariant is being broken, the submission should be a Medium.
I don't think that breaking an invariant alone changes the impact, the impact is judged based on what are the consequences of the issue. And even with the additional context that you've added I still think the appropriate severity is low.
I accept that the original submission has incorrect impact & cannot quality for a H/M. However, the mentioned issue still persists & might not have been mentioned in any other submissions. Even though I haven't submitted any QA report, the said finding should still be considered as a valid Low instead of the being discarded as 'unsatisfactory' because of low quantity.
It does qualify as a valid QA, see my comment in the PJQA thread regarding my method of grading QAs
Lines of code
https://github.com/code-423n4/2023-11-shellprotocol/blob/main/src/ocean/Ocean.sol#L173
Vulnerability details
WRAPPED_ETHER_ID
is an immutable variable which is the ocean id forshETH
. But while initializing it inside the constructor, the wrong hexadecimal value is used to calculate the ocean id.Proof of Concept
Twice inside the Ocean contract it is mentioned that
shETH
is used forWRAPPED_ETHER_ID
.But inside the constructor, the hexadecimal value calculated corresponds to
Ether
& notshETH
.ASCII to Hexadecimal
WRAPPED_ETHER_ID value
Note:
CurveTricryptoAdapter contract specifically mentions - "curve tricrypto adapter contract enabling swapping, adding liquidity & removing liquidity for the curve usdt-wbtc-eth pool"
& the Ocean contract says "this is the oceanId used for shETH" for
WRAPPED_ETHER_ID
Impact
The
zToken
inside contract CurveTricryptoAdapter.sol &WRAPPED_ETHER_ID
inside contract Ocean.sol would be using the same Ocean Id for all their calculations leading to incorrect results & breaking the accounting system.For example, inside
_etherUnwrap()
in Ocean.sol, the fee would be sent to the wrong ocean id i.e. to the id of thezToken
inside CurveTricryptoAdapter.sol.This will lead to incorrect balance of zToken whenever
balanceOf()
is called inside CurveTricryptoAdapter.sol.Tools Used
Manual Review
Recommended Mitigation Steps
Use
shETH
instead ofEther
for calculating ocean id.Assessed type
Error