Description
In Endpoint::depositCollateralWithReferral(), the referral is set to
DEFAULT_REFERRAL_CODE if it is a remote deposit (sender != address(bytes20(subaccount)). Thus, any user may maliciously set other subaccountreferral code to default. It's also possible to do this by submitting a slow mode transaction of type BurnLpAndTransfer.
Recommendation
The specific fix depends on how the referral code is supposed to be handled.
Status
Addressed in #38bbe76.