Open code423n4 opened 1 year ago
raymondfam marked the issue as duplicate of #529
raymondfam marked the issue as low quality report
kirk-baird marked the issue as unsatisfactory: Invalid
kirk-baird changed the severity to QA (Quality Assurance)
kirk-baird marked the issue as grade-c
kirk-baird marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L197-L203 https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L156-L167 https://github.com/code-423n4/2023-09-ondo/blob/47d34d6d4a5303af5f46e907ac2292e6a7745f6c/contracts/bridge/DestinationBridge.sol#L337-L353
Vulnerability details
Impact
The purpose of adding pausability feature in a contract is to prevent the execution of its functions in certain cases; which are mostly emergency cases (when calls to some contracts/tokens start to act maliciously).
The
DestinationBridge
contract implements this feature; where transactions initiation (callingexecute
) is disabled when the contract is paused .But even if the contract is paused; approvers can still approve transactions (by calling
approve
that doesn't check if the contract is paused) and eventually leading these transactions to be executed if they met the approvals threshold.This will break the main purpose of adding the pausability feature; which is protecting the contract in the cases of emergancies; such when the bridged token contract starts to act in a malicious way that will lead to harming the destination bridge.
Proof of Concept
Code: approve function
_approve function
_mintIfThresholdMet function
Foundry PoC:
test_Transaction_Executed_When_Contract_Is_Paused()
test is added toforge-tests/bridges/DestinationBridge.t.sol
file; with the following scenario:DestinationBridge
contract owner pauses the contract.Test result:
Tools Used
Manual Testing & Foundry.
Recommended Mitigation Steps
Update
approve
function to be called only when the contract is not paused:Assessed type
Context