Closed c4-bot-6 closed 7 months ago
https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L499 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L588 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L868 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L870 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L871 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L121 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L124 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L128 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L129
Deriving Price, or rates between assets more generally, can be manipulated from the ratio of balance. Flash loan and donation are the well-known attack vectors used to manipulate the prices. Example code snippet: https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L127
/** @dev See {IYieldToken-actualBalanceOf} */ function actualBalanceOf(address account) public view override returns (uint256) { return super.balanceOf(account); }
Manual review
Implement internal accounting instead of relying on balanceOf.
balanceOf
Other
gzeon-c4 marked the issue as insufficient quality report
invalid
JustDravee marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L499 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L588 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L868 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L870 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L871 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L121 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L124 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L128 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L129
Vulnerability details
Impact
Deriving Price, or rates between assets more generally, can be manipulated from the ratio of balance. Flash loan and donation are the well-known attack vectors used to manipulate the prices. Example code snippet: https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/YieldToken.sol#L127
Tools Used
Manual review
Recommended Mitigation Steps
Implement internal accounting instead of relying on
balanceOf
.Assessed type
Other