yAxis contest - defsec's results

The trusted #DeFi platform to earn reliable returns on digital assets.

General Information

Platform: Code4rena

Start Date: 16/11/2021

Pot Size: $30,000 USDC

Total HM: 3

Participants: 18

Period: 3 days

Judge: leastwood

Total Solo HM: 2

Id: 56

League: ETH

yAxis

Findings Distribution

Researcher Performance

Rank: 6/18

Findings: 3

Award: $1,161.54

🌟 Selected for report: 2

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: TimmyToes

Also found by: defsec

Labels

bug
duplicate
2 (Med Risk)

Awards

1014.5458 USDC - $1,014.55

External Links

Handle

defsec

Vulnerability details

Impact

During the manual code review, It has been observed that minting progress is not checked when the contract is emergency paused. This can cause misfunctionality and unlocking user funds during the emergency pausing.

Proof of Concept

1-) Navigate to "https://github.com/code-423n4/2021-11-yaxis/blob/main/contracts/v3/alchemix/Alchemist.sol#L611" contract. 2-) Observe the following code on the Alchemist.sol.

Functions mint

function mint(uint256 _amount) external nonReentrant noContractAllowed onPriceCheck expectInitialized { CDP.Data storage _cdp = _cdps[msg.sender]; _cdp.update(_ctx); uint256 _totalCredit = _cdp.totalCredit; if (_totalCredit < _amount) { uint256 _remainingAmount = _amount.sub(_totalCredit); if (borrowFee > 0) { uint256 _borrowFeeAmount = _remainingAmount.mul(borrowFee).div( PERCENT_RESOLUTION ); _cdp.totalDebt = _cdp.totalDebt.add(_borrowFeeAmount); xtoken.mint(rewards, _borrowFeeAmount); } _cdp.totalDebt = _cdp.totalDebt.add(_remainingAmount); _cdp.totalCredit = 0; _cdp.checkHealth(_ctx, 'Alchemist: Loan-to-value ratio breached'); } else { _cdp.totalCredit = _totalCredit.sub(_amount); } xtoken.mint(msg.sender, _amount); if (_amount >= flushActivator) { flushActiveVault(); } }

Tools Used

None

Implement the the following require statement into the functions. Only withdraw functions should be allowed on the contract.

require(!emergencyExit, 'emergency pause enabled');
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