Missing Whitelist Check in setApprovedBeneficiary
#10
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
🤖_primary
AI based primary recommendation
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-11-ethena-labs/blob/main/contracts/ustb/UStbMinting.sol#L411-L425
Vulnerability details
Impact
Proof of Concept
Root Cause:
The
setApprovedBeneficiary
function lacks a check to ensure that the caller (msg.sender
) is part of the_whitelistedBenefactors
set. This missing verification allows any address to callsetApprovedBeneficiary
, thereby adding or removing a beneficiary without being a whitelisted benefactor. This oversight undermines the intended restriction on who can manage beneficiaries, posing a significant security risk.Issue in the Code:
The
setApprovedBeneficiary
function currently does not have arequire
statement to check ifmsg.sender
is in the_whitelistedBenefactors
set.Proof of Unauthorized Call:
Any unprivileged user can successfully execute the
setApprovedBeneficiary
function, altering the beneficiary list without restriction.Impact Illustration:
setApprovedBeneficiary
from an unauthorized address to add a fraudulent beneficiary. This newly added beneficiary could be used for unauthorized minting or fund transfers, potentially causing financial loss or system manipulation.Recommended Mitigation Steps
Add a Whitelist Check:
To mitigate this issue, add a
require
statement at the beginning ofsetApprovedBeneficiary
to verify that the caller is in_whitelistedBenefactors
:The text was updated successfully, but these errors were encountered: