Submitted by carrotsmuggler, also found by immeas
In order to put an asset in rescue mode, the admin first needs to call requestSglPoolRescue. This will start a cooldown period and the rescue can only be triggered after the cooldown period has passed. This is evident from the code in the activateSglPoolRescue function.
The issue is that once the rescue has been carried out, the value in sglRescueRequest[sgl.sglAssetID] is not reset. This means if the same asset is added back in, it will now not have any cooldown anymore. The contract will treat the asset as if the rescue request is still ongoing.
The requestSglPoolRescue cannot be called to reset the cooldown, since the value stored is non 0. Since this bypasses a protection mechanism put in place by the devs, this is a medium severity issue.
The problem arises when an asset is rescued, and then added back in. sglRescueRequest[sgl.sglAssetID] is left untouched, and so after being added back in it can be immediately rescued without any cooldown time.
Delete the entry in the sglRescueRequest mapping when the asset is rescued via the activateSglPoolRescue function.
0xRektora (Tapioca) confirmed, but disagreed with severity and commented:
