Closed sherlock-admin2 closed 12 months ago
The following three issues has the same core root cause of no access control for healing, enabling anybody to heal in place of others via Infiltration.heal ()
, Grouping them all together in 1 single finding due to sherlocks duplication rule
Note for watsons: While the fixes mentioned differ, this findings should be duplicated based on sherlocks rule as the root cause is due to anybody being able to heal anybody else's agent. Additionally, the affected lines of code mentioned are all pointing to the same logic in the heal()
function, and if you only allow owner of agent to heal, all of this issues will be mitigated.
I simply selected issue #57 due to a well coded PoC, even though it too lack description of all possible impacts.
This is a valid PvP game strategy.
After further consideration:
heal()
.heal()
blocking NFT transfer as a valid PVP strategy. You can see that the healing (calling heal()
) is initiated not from the owner of the agent, but still blocks transfer as it is checked via assertAgentIdsAreHealing()
. This in turn calls assertAgentIsNotTransferrable()
, hence implying blocking of NFT transfers while healing is intended.It would not count if the DOS, etc. lasts a known, finite amount of time <1 year. If it will result in funds being inaccessible for >=1 year, then it would count as a loss of funds and be eligible for a Medium or High designation. The greater the cost of the attack for an attacker, the less severe the issue becomes.
klaus
medium
heal - attacker can request heal to stop other users from trading NFTs
Summary
Only active, wounded agents can be transferred. Since anyone can request heal the wounded agent owned by another user, attacker can prevent user sell(transfer) agent NFT.
Vulnerability Detail
The
heal
function allows anyone to request to heal the wounded agent that they do not own. Only active or wounded agents can be transferred, not healing, escaped, or dead agents.Users can freely buy and sell agent NFTs on the NFT market. However, if the attacker requests to heal the wounded agent that is selling, the user will not be able to trade agent NFT.
This is the PoC code. Anyone can request to heal the agent, and this agent is no longer transferable.
Impact
Code Snippet
https://github.com/sherlock-audit/2023-10-looksrare/blob/86e8a3a6d7880af0dc2ca03bf3eb31bc0a10a552/contracts-infiltration/contracts/Infiltration.sol#L801
https://github.com/sherlock-audit/2023-10-looksrare/blob/86e8a3a6d7880af0dc2ca03bf3eb31bc0a10a552/contracts-infiltration/contracts/Infiltration.sol#L925-L928
Tool used
Manual Review
Recommendation
Make sure that only the agent owner can request to heal. If
heal
is called from InfiltrationPeriphery contract, passmsg.sender
as parameter and check it.