Platform: Code4rena
Start Date: 18/10/2023
Pot Size: $36,500 USDC
Total HM: 17
Participants: 77
Period: 7 days
Judge: MiloTruck
Total Solo HM: 5
Id: 297
League: ETH
Rank: 46/77
Findings: 2
Award: $45.44
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: MrPotatoMagic
Also found by: Bughunter101, COSMIC-BEE-REACH, HChang26, Stormreckson, T1MOH, Tendency, hals, josephdara, klau5, merlin, tnquanghuy0512, twcctop
37.1417 USDC - $37.14
allowSAFE()
function dose not check the msg.sender == _safeData[_safe].owner
, it may cause the owner loses control
Assume the following scenario:
allowSAFE()
to make Bob a safeCan
user.safeCan
permissionssafeCan
permission to another account (we assume Bob’s other account is called Car) by calling allowSAFE(), without Alice knowing.function allowSAFE(uint256 _safe, address _usr, uint256 _ok) external safeAllowed(_safe) { address _owner = _safeData[_safe].owner; safeCan[_owner][_safe][_usr] = _ok; emit AllowSAFE(msg.sender, _safe, _usr, _ok); }
manual
I suggest adding check msg.sender == _safeData[_safe].owner
to ensure only the owner is allowed to call this function
Access Control
#0 - c4-pre-sort
2023-10-26T04:45:17Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-10-26T04:45:36Z
raymondfam marked the issue as duplicate of #171
#2 - c4-judge
2023-11-02T08:44:24Z
MiloTruck marked the issue as satisfactory
🌟 Selected for report: MrPotatoMagic
Also found by: 0xMosh, 0xPsuedoPandit, 0xhacksmithh, 8olidity, Al-Qa-qa, Baki, Bughunter101, Krace, Stormreckson, T1MOH, Tendency, eeshenggoh, fibonacci, hals, immeas, kutugu, lsaudit, m4k2, mrudenko, okolicodes, phoenixV110, spark, twicek, xAriextz
8.3007 USDC - $8.30
deployCamelotRelayer()
does not check if whether the address is repeated or whether it already exists.deployCamelotRelayer()
does not check if whether the address is repeated or whether it already exists.It will cause waste of calling. I sugguest add check.
openSAFE()
The function allows anyone to call it, which may lead to the proliferation of vault721
I suggest adding permission checks to only allow specific controller calls to prevent vault721
flooding
/// @inheritdoc IODSafeManager function openSAFE(bytes32 _cType, address _usr) external returns (uint256 _id) { if (_usr == address(0)) revert ZeroAddress(); ++_safeId; address _safeHandler = address(new SAFEHandler(safeEngine)); _safeData[_safeId] = SAFEData({owner: _usr, safeHandler: _safeHandler, collateralType: _cType}); _usrSafes[_usr].add(_safeId); _usrSafesPerCollat[_usr][_cType].add(_safeId); vault721.mint(_usr, _safeId);//@audit emit OpenSAFE(msg.sender, _usr, _safeId); return _safeId; }
#0 - c4-pre-sort
2023-10-27T01:03:16Z
raymondfam marked the issue as low quality report
#1 - c4-judge
2023-11-03T16:55:31Z
MiloTruck marked the issue as grade-c
#2 - c4-judge
2023-11-03T18:00:43Z
MiloTruck marked the issue as grade-b