RToken can manipulate distribution to avoid paying DAO fees
Governance of an RToken can manipulate the distribution settings so that RSR revenue accumulates in the rsrTrader and is later redistributed with a different ratio, reducing the DAO fee paid from 10% to about 1%. This allows the RToken to avoid paying most of the DAO fee.
Originally disclosed on Code4rena
Submitted by RadiantLabs
Revenue produced by RTokens is sold for both RSR and RTokens according to a distribution defined in the Distributor. The BackingManager splits the collateral tokens to be sold proportionately to the RSR/RToken distribution ratio and sends them to the rsrTrader and rTokenTrader. When trades settle, the obtained RSR or RTokens are sent to the Distributor, which distributes them no longer according to the RSR/RToken ratio but to the different destinations for the specific token. The sum of all destinations for each token is used to derive the ratio.
The DAO fee is added to the RSR share of the initial split and paid when RSR is distributed.
However, the current implementation allows governance to manipulate the distribution settings without much effort in a way that can significantly reduce the amount of DAO fees paid.
This can be achieved through a combination of two different root causes:
- an RSR destination can be added that prevents rewards from being immediately distributed
- the RSR/RToken ratio is calculated twice: once in the
BackingManager, and once in theDistributor, and it is can be modified between the two
Essentially, the distribution can be set in a way that temporarily accumulates RSR revenue in in the rsrTrader according to one RSR/RToken ratio, and then later redistributed with a different ratio.
Impact
RTokens can avoid paying most of the DAO fee
Proof of Concept
Assuming a 10% DAO fee, governance can execute the following steps to pay only about 1% in fees:
- Set the distribution such that
rsrTotal == 0before DAO fees are added. - Add the RSR token itself as a distribution target. Like stRSR, RSR does not allow transferring to itself, so the distribution will always fail.
- 10% of revenue will accumulate as RSR in the
rsrTrader. - After some time, change the distribution such that
rTokenTotal == 0and add another destination with non-zerorsrDist(e.g.,stRSR). - Remove RSR as a distribution target and call
rsrTrader.distributeTokenToBuy(). - Only 10% of the accumulated RSR will go to the DAO, which is effectively 1% of the total revenue.
- Repeat this process as needed.
Recommended Mitigation Steps
Disallowing RSR as a distribution token prevents this to a large extent.
Will try to get the sponsor’s opinion, and will set it to valid before the sponsor responds. It’s about Malicious Governance, though it actually compromises the DAO, so it’s probably a privilege escalation.
akshatmittal (Reserve) disputed and commented:
This is a known issue, changing Distributions in a specific way can change what is actually paid out to veRSR. See publicly known issues as well as the Trust report specifically.
The way I’m seeing it: a new finding (RSR self-entries in the distributor table cause distribution to revert) raises the previously known issue TRST-L-2 in severity from Low to Medium, due to what is effectively privilege escalation by avoiding paying the DAO fee.
Status: Mitigation confirmed. Full details in reports from Bauchibred, ether_sky and RadiantLabs.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the distribution ratio is calculated twice (in BackingManager and Distributor) and can be changed between the two, and RSR can be added as a distribution target that causes transfers to fail, allowing revenue to accumulate and be redistributed under a different ratio.
What the attacker needed
Control over RToken governance; ability to change distribution settings
The fix
Disallowing RSR as a distribution token should prevent this to a large extent, and the project mitigated the issue.
How it was found
- Set the distribution so that rsrTotal is zero before DAO fees are added.
- Add RSR itself as a distribution target, which causes distribution to always fail because RSR cannot be transferred to itself.
- Allow 10% of revenue to accumulate as RSR in the rsrTrader.
- After some time, change the distribution so that rTokenTotal is zero and add another destination with non-zero rsrDist (e.g., stRSR).
- Remove RSR as a distribution target and call rsrTrader.distributeTokenToBuy().
- Only 10% of the accumulated RSR goes to the DAO, effectively 1% of total revenue, and repeat as needed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
An RToken is a token backed by collateral, and its revenue is split between RSR (a staking token) and RToken holders, with a portion going to the DAO as a fee. The report shows that the people who control the RToken's settings can change the distribution rules in a way that makes the fee much smaller than intended. This is a problem because it lets them keep more money for themselves instead of supporting the DAO.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.