Platform: Code4rena
Start Date: 09/12/2022
Pot Size: $90,500 USDC
Total HM: 35
Participants: 84
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 12
Id: 192
League: ETH
Rank: 24/84
Findings: 4
Award: $638.12
🌟 Selected for report: 0
🚀 Solo Findings: 0
62.1081 USDC - $62.11
Detailed description of the impact of this finding. _checkDelay is not properly implemented due to failure to check the open case in the following line:
if (_delay.actionType == _type) {
As a result, the purpose of profit-taking in the same or close blocks cannot be prevented as the documentation requires "This is to prevent profitable opening and closing in the same tx with two different prices in the "valid signature pool""
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/Trading.sol#L857-L868
Remix
This is probabally a typo the fix is easy as follows:
function _checkDelay(uint _id, bool _type) internal { unchecked { Delay memory _delay = blockDelayPassed[_id]; if (_type) { // @audit< this the open case blockDelayPassed[_id].delay = block.number + blockDelay; } else { // @audit this is the close case if (block.number < _delay.delay) revert("0"); //Wait blockDelayPassed[_id].delay = block.number + blockDelay; blockDelayPassed[_id].actionType = _type; } } }
#0 - GalloDaSballo
2022-12-23T16:34:53Z
Basically dup of #108 but the warden didn't "twist the knife" and used it to profit, so am awarding 50%
#1 - c4-judge
2022-12-23T16:35:02Z
GalloDaSballo marked the issue as duplicate of #108
#2 - GalloDaSballo
2022-12-23T16:35:16Z
Recommend you write a coded POC next time, it will help identify the risk free attack
#3 - c4-judge
2023-01-16T09:44:44Z
GalloDaSballo marked the issue as partial-50
#4 - c4-judge
2023-01-16T09:44:51Z
GalloDaSballo changed the severity to 2 (Med Risk)
567.9755 USDC - $567.98
Detailed description of the impact of this finding. The calculation of _feePaid is not correct, it does not reflect the referral fee.
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/Trading.sol#L734-L738
Remix
The corrrect calculation is:
_feePaid = _positionSize * (_fees.referralFees + _fees.botFees) // get total fee% / DIVISION_CONSTANT // divide by 100% + _daoFeesPaid;
#0 - c4-judge
2022-12-22T02:04:53Z
GalloDaSballo marked the issue as duplicate of #476
#1 - c4-judge
2023-01-16T08:53:08Z
GalloDaSballo changed the severity to 2 (Med Risk)
#2 - c4-judge
2023-01-22T17:48:44Z
GalloDaSballo marked the issue as satisfactory
#3 - c4-judge
2023-01-30T15:13:15Z
GalloDaSballo marked the issue as duplicate of #367
🌟 Selected for report: 0xA5DF
Also found by: 0xA5DF, 0xNazgul, 0xSmartContract, 0xbepresent, 0xdeadbeef0x, 8olidity, Englave, Faith, HE1M, JohnnyTime, Madalad, Mukund, Ruhum, SmartSek, __141345__, aviggiano, carlitox477, cccz, chaduke, francoHacker, gz627, gzeon, hansfriese, hihen, imare, jadezti, kwhuo68, ladboy233, orion, peanuts, philogy, rbserver, wait, yjrwkk
1.1472 USDC - $1.15
Detailed description of the impact of this finding.
A compromised or malicious owner of PairsContract
can manipulate chainlinkFeed
price
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
A compromised or malicious owner of PairsContract
can manipulate chainlinkFeed price as follows:
setAssetChainlinkFeed(uint256 _asset, address _MalicousFeed)
, now the _maliciousFeed
becomes the fake chainlinkFeed_maliciousFeed
and used in the advantage of the attacker to gain profit in tradingRemix
The owner should be not allowed to change the chainlinkFeed
, all chainlinkFeeds should be defined as constants and explicit. Use proxy pattern to include new feeds when necessary.
#0 - c4-judge
2022-12-23T17:53:19Z
GalloDaSballo marked the issue as duplicate of #418
#1 - c4-judge
2023-01-15T13:54:57Z
GalloDaSballo marked the issue as duplicate of #377
#2 - c4-judge
2023-01-22T17:33:32Z
GalloDaSballo marked the issue as satisfactory
🌟 Selected for report: yjrwkk
Also found by: 0x4non, 0xDecorativePineapple, 0xdeadbeef0x, Avci, Critical, Deivitto, Dinesh11G, Englave, Tointer, ak1, chaduke, izhelyazkov, pwnforce, rbserver, rvierdiiev, unforgiven
6.8789 USDC - $6.88
Judge has assessed an item in Issue #50 as M risk. The relevant finding follows:
QA10. https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/StableVault.sol#L44 The deposit() function only works for tokens that have no more than 18 decimals. This needs to be documented.
#0 - c4-judge
2023-01-23T08:15:29Z
GalloDaSballo marked the issue as duplicate of #533
#1 - c4-judge
2023-01-23T08:15:36Z
GalloDaSballo marked the issue as satisfactory
#2 - c4-judge
2023-01-23T08:15:49Z
GalloDaSballo marked the issue as partial-50
#3 - GalloDaSballo
2023-01-23T08:15:54Z
1 liner -> 50%