Closed c4-submissions closed 1 year ago
https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/proxies/ODSafeManager.sol#L235 https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/proxies/ODSafeManager.sol#L242
Users can add SAFE instances that do not belong to them, and once added, there is no way to remove them.
The absence of access control in the addSAFE() function enables users to add SAFE instances that belong to others.
addSAFE()
function addSAFE(uint256 _safe) external { SAFEData memory _sData = _safeData[_safe]; _usrSafes[msg.sender].add(_safe); _usrSafesPerCollat[msg.sender][_sData.collateralType].add(_safe); }
Once a SAFE has been added, it becomes impossible to remove it because the removeSAFE() function is protected by the safeAllowed modifier. Only the owner or authorized individuals can call this function.
removeSAFE()
safeAllowed
function removeSAFE(uint256 _safe) external safeAllowed(_safe) { SAFEData memory _sData = _safeData[_safe]; _usrSafes[_sData.owner].remove(_safe); _usrSafesPerCollat[_sData.owner][_sData.collateralType].remove(_safe); }
Manual Review
function addSAFE(uint256 _safe) external { SAFEData memory _sData = _safeData[_safe]; + require(msg.sender == _sDate.owner; _usrSafes[msg.sender].add(_safe); _usrSafesPerCollat[msg.sender][_sData.collateralType].add(_safe); }
Access Control
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as duplicate of #288
MiloTruck changed the severity to QA (Quality Assurance)
MiloTruck marked the issue as grade-c
Lines of code
https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/proxies/ODSafeManager.sol#L235 https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/proxies/ODSafeManager.sol#L242
Vulnerability details
Impact
Users can add SAFE instances that do not belong to them, and once added, there is no way to remove them.
Proof of Concept
The absence of access control in the
addSAFE()
function enables users to add SAFE instances that belong to others.Once a SAFE has been added, it becomes impossible to remove it because the
removeSAFE()
function is protected by thesafeAllowed
modifier. Only the owner or authorized individuals can call this function.Tools Used
Manual Review
Recommended Mitigation Steps
Assessed type
Access Control