Closed c4-bot-3 closed 8 months ago
gzeon-c4 marked the issue as sufficient quality report
gzeon-c4 marked the issue as primary issue
yanisepfl marked the issue as disagree with severity
This is a good catch indeed. However, we disagree with the issue's severity and consider it as a QA report.
yanisepfl (sponsor) disputed
JustDravee marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/perspectivefi/spectra-core/blob/main/src/tokens/PrincipalToken.sol#L72 https://github.com/perspectivefi/spectra-core/blob/main/src/tokens/PrincipalToken.sol#L370 https://github.com/perspectivefi/spectra-core/blob/main/src/tokens/PrincipalToken.sol#L378 https://github.com/perspectivefi/spectra-core/blob/main/src/tokens/PrincipalToken.sol#L848-L859
Vulnerability details
Impact
The event YieldClaimed is defined as follows:
It is emitted in
_claimYield
function withreceiver
equal tomsg.sender
even if this not the receiver._claimYield is only used in those 2 functions:
In the case where
_receiver
differs frommsg.sender
, it will emit an event with wrong parameters.Tools Used
Manual review
Recommended Mitigation Steps
The event should be emitted in the
claimYield
andclaimYieldInIBT
functions directly, and deleted in the_claimYield
function.Assessed type
Other