Salty.IO - Ephraim's results

An Ethereum-based DEX with zero swap fees, yield-generating Automatic Arbitrage, and a native WBTC/WETH backed stablecoin.

General Information

Platform: Code4rena

Start Date: 16/01/2024

Pot Size: $80,000 USDC

Total HM: 37

Participants: 178

Period: 14 days

Judge: Picodes

Total Solo HM: 4

Id: 320

League: ETH

Salty.IO

Findings Distribution

Researcher Performance

Rank: 136/178

Findings: 2

Award: $25.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

16.3165 USDC - $16.32

Labels

bug
3 (High Risk)
satisfactory
duplicate-137

External Links

Lines of code

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L115 https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L125 https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L128

Vulnerability details

Impact

Detailed description of the impact of this finding.

Double burning of USDS tokens occurs when users repay their borrowed USDS.

Users repay their borrowed USDS through the CollateralAndLiquidity.sol. However, these tokens are to be sent into the Liquidizer contract that handles the burning of USDS tokens and holds some USDS token that serves as burnable buffer. When users call the repayUSDS token from the CollateralAndLiquidity, these USDS tokens are directly sent into the usds contract. https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L125

This is followed with a corresponding increment in the usdsThatShouldBeBurned state variable in the Liquidizer.sol. This variable notes the value of USDS to be burned.

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L128

In the future when upkeep is performed, tokens in the liquidizer would be burned due to the usdsThatShouldBeBurned value and the repaid USDS tokens directly sent into the USDS contract.

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://gist.github.com/Ephraim-nonso/420097aa1bf24c5cd722420dce171e2a

Tools Used

Manual Review and Foundry

Send repaid tokens to the liquidizer contract instead of usds contract.

-- usds.safeTransferFrom(msg.sender, address(usds), amountRepaid); ++ usds.safeTransferFrom(msg.sender, address(liquidizer), amountRepaid);

Assessed type

ERC20

#0 - c4-judge

2024-02-02T14:02:01Z

Picodes marked the issue as duplicate of #618

#1 - c4-judge

2024-02-17T18:38:20Z

Picodes marked the issue as satisfactory

Awards

8.7582 USDC - $8.76

Labels

bug
2 (Med Risk)
satisfactory
duplicate-838

External Links

Lines of code

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/ManagedWallet.sol#L49

Vulnerability details

Impact

Detailed description of the impact of this finding. If the confirmation wallet at any point rejects wallet proposal invoked by the mainWallet, this will deny the mainWallet the ability to propose wallets in the future. The problem is caused by this check:

require(proposedMainWallet == address(0), "Cannot overwrite non-zero proposed mainWallet.");

Scenario before a Rejection:

  • When mainWallet invokes the proposeWallets function
  • proposedMainWallet state variable is updated to the address proposed
  • Confirmation wallet rejects with sending less than the required ether

Scenario after a Rejection:

  • Reverts when mainWallets invokes proposeWallets function in the future because the proposedMainWallet is non-zero address.

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://gist.github.com/Ephraim-nonso/be99a50aad9504b0ca34c105e8d109c1

Tools Used

Manual and Foundry

Update the proposedMainWallet to zero address in the receive function when confirmation wallet sends less than 0.05 ether.

Assessed type

Other

#0 - c4-judge

2024-02-02T10:42:46Z

Picodes marked the issue as duplicate of #838

#1 - c4-judge

2024-02-17T18:22:27Z

Picodes marked the issue as satisfactory

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