Tigris Trade contest - chaduke's results

A multi-chain decentralized leveraged exchange featuring instant settlement and guaranteed price execution on 30+ pairs.

General Information

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

Tigris Trade

Findings Distribution

Researcher Performance

Rank: 24/84

Findings: 4

Award: $638.12

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: KingNFT

Also found by: 0x52, Critical, chaduke, noot, orion

Labels

bug
2 (Med Risk)
downgraded by judge
partial-50
duplicate-108

Awards

62.1081 USDC - $62.11

External Links

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/Trading.sol#L857-L868

Vulnerability details

Impact

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""

Proof of Concept

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

Tools Used

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)

Findings Information

🌟 Selected for report: 0Kage

Also found by: chaduke

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
duplicate-367

Awards

567.9755 USDC - $567.98

External Links

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/496e1974ee3838be8759e7b4096dbee1b8795593/contracts/Trading.sol#L734-L738

Vulnerability details

Impact

Detailed description of the impact of this finding. The calculation of _feePaid is not correct, it does not reflect the referral fee.

Proof of Concept

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

Tools Used

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

Awards

1.1472 USDC - $1.15

Labels

bug
2 (Med Risk)
satisfactory
duplicate-377

External Links

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/588c84b7bb354d20cbca6034544c4faa46e6a80e/contracts/PairsContract.sol#L33-L37

Vulnerability details

Impact

Detailed description of the impact of this finding. A compromised or malicious owner of PairsContract can manipulate chainlinkFeed price

Proof of Concept

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:

  1. call setAssetChainlinkFeed(uint256 _asset, address _MalicousFeed), now the _maliciousFeed becomes the fake chainlinkFeed
  2. false price can be provided by the _maliciousFeed and used in the advantage of the attacker to gain profit in trading

Tools Used

Remix

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

Awards

6.8789 USDC - $6.88

Labels

2 (Med Risk)
partial-50
duplicate-533

External Links

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%

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter