d-and-ddApp Security Guidelines: LSD

Threat 1: Manipulation of iBERA/BERA Exchange Rate through Mass Deposits and Withdrawals

If an attacker momentarily manipulates the iBERA/BERA exchange rate with a large transaction, they can gain unfair profits while other users suffer losses. This ultimately reduces the protocol's assets and undermines user trust, harming system stability.

Impact

Medium

It is rated as Medium because it can directly affect system stability by reducing protocol assets and undermining trust.

Guideline

Best Practice

InfraredBERA.solarrow-up-right

function mint(address receiver) public payable returns (uint256 shares) {
    compound(); // Settle and reflect unrealized profits

    uint256 d = deposits;
    uint256 ts = totalSupply();

    uint256 amount = msg.value;
    // Synchronize external fund inflow by calling the BeaconDeposit contract via the queue function in the InfraredBERADepositor contract
    _deposit(amount);

    // Process at 1:1 during initialization, then proportionally to the deposit ratio
    shares = (d != 0 && ts != 0) ? (ts * amount) / d : amount;
    // Handle exceptions during initialization attempts
    if (shares == 0) revert Errors.InvalidShares();
    _mint(receiver, shares);

    emit Mint(receiver, amount, shares);
}

Threat 2: Malicious Actor Profit Maximization through Mass Harvesting Before/After Fee Changes

If a malicious actor exploits the timing of a protocol fee change to harvest a large amount of rewards just before or after the change, they can distort the fair reward distribution system, gaining unfair profits for themselves while causing losses to other users or the protocol's treasury. This ultimately undermines the fairness and trustworthiness of the system.

Impact

Low

Exploiting the timing of fee changes to harvest large rewards can lead to some users gaining unfair profits and causing losses to other users or the protocol's treasury. However, the impact on the overall stability or security of the system is limited, so it is rated Low.

Guideline

Best Practice

InfraredV1_2.solarrow-up-right

InfraredV1_5.solarrow-up-right


Threat 3: Contamination of the Bribe System through Tokens Susceptible to Malicious Behavior

Using tokens with the potential for malicious behavior as reward tokens in the Bribe system undermines the reliability and fairness of the Bribe system. This ultimately weakens the competitiveness of honest protocols and disrupts the healthy incentive flow of the ecosystem.

Impact

Low

The system's reliability and fairness are undermined, which can weaken the competitiveness of honest protocols. However, the damage is limited to incentive distortion and operational issues, so it is rated Low.

Guideline

Best Practice

RewardLib.solarrow-up-right

BribeCollectorV1_3.solarrow-up-right


Threat 4: Reward Imbalance and Centralization Due to Fund Concentration in Specific Validators

If funds are excessively concentrated in a few validators, they will monopolize most of the rewards, discouraging other validators from participating and making it difficult for new ones to enter. This ultimately leads to the concentration of decision-making power in the network in the hands of a few, undermining decentralization and harming the overall stability and fairness of the system.

Impact

Informational

Most of the rewards could be monopolized by a few validators, and the network's decision-making power could become concentrated, undermining decentralization and system fairness. However, this is considered a structural and operational issue that affects network decentralization and participation incentives rather than a direct security threat, so it is rated Informational.

Guideline

  • To address the concentration of funds in large validators, an issue raised in major PoS chains like Ethereum and Solana, prevent reward imbalance and centralization by setting a maximum staking limit60 per validator.

  • To prevent network instability caused by a validator's long-term abnormal behavior, it is necessary to introduce a real-time status tracking20 and automatic forced exit system.

  • To prevent the possibility of centralization and reward imbalance if restaking or new delegations are concentrated on a few validators, apply a delegation policy that automatically distributes61 funds to multiple validators.

  • To prevent the weakening of network decentralization and liquidity due to low user participation, provide activity rewards similar to Curve Finance's LP token rewardsarrow-up-right to promote participation and fund distribution.

Best Practice

InfraredBERADepositor.solarrow-up-right

Last updated