PoolTogether - RedTiger's results

A protocol for no-loss prize savings

General Information

Platform: Code4rena

Start Date: 07/07/2023

Pot Size: $121,650 USDC

Total HM: 36

Participants: 111

Period: 7 days

Judge: Picodes

Total Solo HM: 13

Id: 258

League: ETH

PoolTogether

Findings Distribution

Researcher Performance

Rank: 22/111

Findings: 2

Award: $1,481.83

🌟 Selected for report: 1

🚀 Solo Findings: 0

Awards

2.2492 USDC - $2.25

Labels

bug
3 (High Risk)
satisfactory
edited-by-warden
duplicate-396

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L394

Vulnerability details

Impact

Anyone can steal the YieldFee available in Vault.sol

Proof of Concept

The function mintYieldFee is external and everybody can call it to mint shares. The only condition is that the number of _shares should be lower or eaqual than _yieldFeeTotalSupply

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L394C39-L402

 function mintYieldFee(uint256 _shares, address _recipient) external {
    _requireVaultCollateralized();
    if (_shares > _yieldFeeTotalSupply) revert YieldFeeGTAvailable(_shares, _yieldFeeTotalSupply);

    _yieldFeeTotalSupply -= _shares;
    _mint(_recipient, _shares);

    emit MintYieldFee(msg.sender, _recipient, _shares);
  }

This is an issue as anyone can steal the yield fee available by changing the _recipient input to any address. The different functions related to mintfee are all only callable by the the owner of the vault.

Tools Used

Manual review

Use the onlyOwner modifier for mintYieldFee or change the function mintYieldFee(uint256 _shares, address _recipient) to only mintYieldFee(uint256 shares) and use as recipient the yieldFeeRecipient, that is never used.

Assessed type

Invalid Validation

#0 - c4-judge

2023-07-14T22:20:52Z

Picodes marked the issue as duplicate of #396

#1 - c4-judge

2023-08-05T22:04:14Z

Picodes marked the issue as satisfactory

Findings Information

🌟 Selected for report: RedTiger

Also found by: wangxx2026, zzzitron

Labels

bug
3 (High Risk)
primary issue
satisfactory
selected for report
upgraded by judge
H-07

Awards

1479.5831 USDC - $1,479.58

External Links

Lines of code

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L557

Vulnerability details

Impact

The liquidate() and mintYieldFee() functions could leave the vaults undercollateralized.

Proof of Concept

_requireVaultCollateralized() is called at the beginning of mintYieldFee() and liquidate(). Or these two functions change the state, and the vault could become undercollateralized at the end of the functions.

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L557

function mintYieldFee(uint256 _shares, address _recipient) external {
    _requireVaultCollateralized();
    if (_shares > _yieldFeeTotalSupply) revert YieldFeeGTAvailable(_shares, _yieldFeeTotalSupply);

https://github.com/GenerationSoftware/pt-v5-vault/blob/b1deb5d494c25f885c34c83f014c8a855c5e2749/src/Vault.sol#L395

  function mintYieldFee(uint256 _shares, address _recipient) external {
    _requireVaultCollateralized();
    if (_shares > _yieldFeeTotalSupply) revert YieldFeeGTAvailable(_shares, _yieldFeeTotalSupply);

Tools Used

Manual review

Call _requireVaultCollateralized() at the end of these functions instead of calling it at the beginning.

Assessed type

Invalid Validation

#0 - c4-judge

2023-07-18T20:02:22Z

Picodes marked the issue as duplicate of #307

#1 - c4-judge

2023-08-06T10:54:41Z

Picodes marked the issue as partial-50

#2 - c4-judge

2023-08-06T10:55:21Z

Picodes marked the issue as satisfactory

#3 - c4-judge

2023-08-06T10:55:29Z

Picodes changed the severity to 3 (High Risk)

#4 - c4-judge

2023-08-14T17:41:40Z

Picodes marked the issue as selected for report

#5 - asselstine

2023-08-17T21:02:40Z

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