Open hats-bug-reporter[bot] opened 1 year ago
Hello, Thanks a lot for your attention. We can already stop a bond by changing the oracleParams, so if an exploit occurs on a bonded-token we would simply trigger this function to prevent losses. In conclusion we have so to consider this issue as invalid.
Github username: @0xmuxyz Submission hash (on-chain): 0x3645d3d8ecd33cf7dc84e94afb1d0581b535334a77de217f04a5da437094036f Severity: medium
Description: Title:\ Due to lack of a function to remove an existing bond (
bondId
), a user would still be able to deposit a bonded-token into the existing bond (bondId
) via the ibo#deposit()
even if the bonded-token was exploitedSeverity:\ Medium
Description:\ Within the ibo contract, the BondParams struct would be defined and the bonded
token
(i.e. $CRV, $FRAX, $CVX) would be defined as a property of it like this:\ Ibo.sol#L29Within the ibo contract, the
bondsParams
storage would be defined to associate abondId
with a bond data in the form of theBondParams
struct like this:\ Ibo.sol#L92When the owner create a new bond, the owner call the Ibo#
createBond()
. Within the Ibo#createBond()
, new bond data (bondParams
) would be stored into thebondsParams
storage with the new bond ID (nextIdBond
). By doing so, a bonded-token (i.e. $CRV, $FRAX, $CVX) would be associated with the newbondId
like this:\ Ibo.sol#L120However, within the ibo contract, there is no function to remove an existing bond (
bondId
).If a bonded-token (i.e. $CRV, $FRAX, $CVX) of an existing bond (
bondId
) would be exploited, there is no way for the owner to stop bonding process of the existing bond (bondId
).As a result, a user would still be able to deposit a bonded-token into the existing bond (
bondId
) via the ibo#deposit()
even if the bonded-token was exploited.\ Ibo.sol#L142-L220NOTE: Especially, $CRV and $FRAX, which are used as a bonded-token in the Convergence Finance, would have some risks to be exploited respectively.
For example:
de-peg
risk in the future.Recommendation:\ Within the ibo contract, consider adding a function to remove an existing bond (
bondId
) so that the owner to stop bonding process of the existing bond (bondId
) if the bonded-token is exploited like this:In addition to that, within the ibo#
deposit()
, consider adding a validation to check whether or not the destination bond (bondId
) would be active to deposit a bonded-token.