Skip to content
DoS Audit finding Intermediate

Slashing fails if claims revert

The slashing function calls a claim function that claims yield from all plugins; if any claim reverts, the entire slashing transaction reverts. An attacker could exploit this by causing a claim to fail, preventing slashing and allowing the slashed user to claim yield and exit.

hickuphh3 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2022-11-telcoin-judging/issues/5

Found by

hickuphh3

Summary

Slashing claims yields for the slashed account as part of the process. Should claims revert, slashing attempts will revert too.

Vulnerability Detail

Slashing calls the underlying _claimAndExit() function, which claims yield from all plugins. Should one or more claims fail, slashing will revert as well.

Impact

Failing claims brick the slashing functionality until the erroneous plugin(s) are removed. During which, the slashed user could have claimed his yield and exited.

Code Snippet

https://github.com/sherlock-audit/2022-11-telcoin/blob/main/contracts/StakingModule.sol#L403-L406 https://github.com/sherlock-audit/2022-11-telcoin/blob/main/contracts/StakingModule.sol#L356-L379

Tool used

Manual Review

Recommendation

Create another slash() method that skips claiming yields of the slashed account.

Discussion

amshirif

https://github.com/telcoin/telcoin-staking/pull/16

jack-the-pug

Fix confirmed

The original report as published on Sherlock, by hickuphh3. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

The slashing function unnecessarily calls a claim function that can revert, coupling slashing success to the success of all yield claims.

Impact

Failing claims brick the slashing functionality until the erroneous plugin(s) are removed, during which the slashed user could have claimed his yield and exited.

What the attacker needed

A staking system with slashing and yield plugins; a plugin that can be made to revert

The fix

A separate slash method that skips claiming yields of the slashed account was implemented and confirmed fixed.

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.

In a staking system, slashing is a penalty that removes a user's staked tokens. This report found that the slashing process also tries to claim rewards from various plugins, and if any of those claims fail, the whole slashing fails. That means a user could avoid being slashed by making a claim fail, then quickly take their rewards and leave.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by hickuphh3

View all

43 more disclosed reports, best first.

More from Telcoin Platform Audit

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.