/yp-sa

B3- Find Any Bug/ Potential Vulnerability In Smart Contract (YP)

Primary LanguageShell

Vulnerability Summary - Yieldprotocol

This is a summary with vulnerabilites of medium impact. A complete report can be found here. Vulnerabilities of high impact could not be found.

POC

The complete report can be recreated by running yp_sa.sh. Make sure to have git, slither-analyzer and solc-select preinstalled.

Summary

unused-return-yield-utils-v2

Recommendation

Ensure that all the return values of the function calls are used.

Description

Impact: Medium Confidence: Medium Smart contract under scope: https://github.com/yieldprotocol/yield-utils-v2/tree/main/lib/forge-std/lib/ds-test/demo/demo.sol

yield-utils-v2/lib/forge-std/lib/ds-test/demo/demo.sol#L43-L45

reentrancy-no-eth-I-yield-utils-v2

Recommendation

Apply the check-effects-interactions pattern.

Description

Impact: Medium Confidence: Medium Smart contract under scope: https://github.com/yieldprotocol/yield-utils-v2/tree/main/src/token/ERC20Rewards.sol

yield-utils-v2/src/token/ERC20Rewards.sol#L104-L124

yield-utils-v2/src/token/ERC20Rewards.sol#L128-L139

yield-utils-v2/src/token/ERC20Rewards.sol#L68-L100

yield-utils-v2/src/token/ERC20Rewards.sol#L142-L149

yield-utils-v2/src/token/ERC20Rewards.sol#L152-L159

yield-utils-v2/src/token/ERC20Rewards.sol#L186-L195

yield-utils-v2/src/token/ERC20Rewards.sol#L162-L167

mapping-deletion-yield-utils-v2

Recommendation

Use a lock mechanism instead of a deletion to disable structure containing a mapping.

Description

Impact: Medium Confidence: High Smart contract under scope: https://github.com/yieldprotocol/yield-utils-v2/tree/main/src/utils/EmergencyBrake.sol

yield-utils-v2/src/utils/EmergencyBrake.sol#L175-L192

uninitialized-local-yield-utils-v2

Recommendation

Initialize all the variables. If a variable is meant to be initialized to zero, explicitly set it to zero to improve code readability.

Description

Impact: Medium Confidence: Medium Smart contract under scope: https://github.com/yieldprotocol/yield-utils-v2/tree/main/src/utils/EmergencyBrake.sol

yield-utils-v2/src/utils/EmergencyBrake.sol#L94

yield-utils-v2/src/utils/EmergencyBrake.sol#L129

divide-before-multiply-yield-utils-v2

Recommendation

Consider ordering multiplication before division.

Description

Impact: Medium Confidence: Medium Smart contract under scope: https://github.com/yieldprotocol/yield-utils-v2/tree/main/src/utils/Math.sol

yield-utils-v2/src/utils/Math.sol#L41-L116

reentrancy-no-eth-II-yield-utils-v2

Recommendation

Apply the check-effects-interactions pattern.

Description

Impact: Medium Confidence: Medium Smart contract under scope: https://github.com/yieldprotocol/yield-utils-v2/tree/main/src/token/ERC20Rewards.sol

yield-utils-v2/src/token/ERC20Rewards.sol#L104-L124

yield-utils-v2/src/token/ERC20Rewards.sol#L128-L139

yield-utils-v2/src/token/ERC20Rewards.sol#L68-L100

yield-utils-v2/src/token/ERC20Rewards.sol#L142-L149

yield-utils-v2/src/token/ERC20Rewards.sol#L152-L159

yield-utils-v2/src/token/ERC20Rewards.sol#L186-L195

yield-utils-v2/src/token/ERC20Rewards.sol#L162-L167

write-after-write-vault-v2

Recommendation

Fix or remove the writes.

Description

Impact: Medium Confidence: High Smart contract under scope: https://github.com/yieldprotocol/vault-v2/tree/main/src/mocks/oracles/OracleMock.sol

vault-v2/src/mocks/oracles/OracleMock.sol#L12

divide-before-multiply-vault-v2

Recommendation

Consider ordering multiplication before division.

Description

Impact: Medium Confidence: Medium Smart contract under scope: https://github.com/yieldprotocol/vault-v2/tree/main/src/oracles/uniswap/uniswapv0.8/FullMath.sol

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

vault-v2/src/oracles/uniswap/uniswapv0.8/FullMath.sol#L14-L106

erc20-interface-vault-v2

Recommendation

Set the appropriate return values and types for the defined ERC20 functions.

Description

Impact: Medium Confidence: High Smart contract under scope: https://github.com/yieldprotocol/vault-v2/tree/main/src/other/tether/IUSDT.sol

vault-v2/src/other/tether/IUSDT.sol#L7-L34

vault-v2/src/other/tether/IUSDT.sol#L7-L34

vault-v2/src/other/tether/IUSDT.sol#L7-L34

References

https://github.com/crytic/slither