-
Notifications
You must be signed in to change notification settings - Fork 5
eeshenggoh - Lack of check if proxy executed was successful leading to inaccurate update of rewards #84
Comments
1 comment(s) were left on this issue during the judging contest. takarez commented:
|
The vulnerability here is that it isn't handled with the reverted data at all. This means that since it isn't handled the data price will always be staled. Since, it always gets reverted without exception, the protocol final balance will remain the same, causing each player to not get the deducted rewards distribution. Hence protocol loses lots of funds because it is permanently staled data and will never updated. Therefore it is clear it is a high vuln. |
@goheesheng @amshirif In what scenarios will a revert be triggered? I will have to look more into the out of scope proxy contract mentioned here to ensure this did not arise because of user input error. |
request poc |
PoC requested from @goheesheng Requests remaining: 6 |
Have confirmed with developer from Sablier team Andreivladbrg. |
@goheesheng Can you share the discussion between you and sablier? |
@nevillehuang the above by @goheesheng is correct |
"The transaction would fail" |
@amshirif @goheesheng Assuming call can silently fail without revert. Exactly where and which funds are lost? How propesed solution helps? |
Escalate |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Silent reverts can be variant of a DoS but it will return a value which can be checked via the if statement |
Also using the #139 is using stream directly and hence changing the address. But there isn't a check for the returned value, hence it's clearly non duplicate of #139. |
This is clearly not a valid issue as the https://etherscan.io/address/0x584009E9eDe26e212182c9745F5c000191296a78#code#F5#L123 if (!success) {
// If there is return data, the delegate call reverted with a reason or a custom error, which we bubble up.
if (response.length > 0) {
assembly {
// The length of the data is at `response`, while the actual data is at `response + 32`.
let returndata_size := mload(response)
revert(add(response, 32), returndata_size)
}
} else {
revert PRBProxy_ExecutionReverted();
}
}
And the execution will revert here and it doesnt matter what data it returns, if there really was a silent revert then it would be a problem in the PRBProxy not in the telcoin contracts. PRBProxy.execute() is not called with .call() so we dont need to check the return value because execution will revert there and the transaction will fail |
I agree with the escalation. |
In that case this issue should be invalid. |
Planning to accept escalation and invalidate issue |
Result: |
Escalations have been resolved successfully! Escalation status:
|
The protocol team fixed this issue in PR/commit https://github.com/telcoin/telcoin-audit/pull/37. |
The Lead Senior Watson signed-off on the fix. |
eeshenggoh
high
Lack of check if proxy executed was successful leading to inaccurate update of rewards
Summary
CouncilMember::_retrieve()
is used to retrieve and distribute TELCOIN to council members based on the stream from_target
. It uses a Sabiler PRBproxy to withdraw tokens to theCouncilMembers
contract. The problem lies in not checking whether the transaction is successful.Vulnerability Detail
The
CouncileMember.sol::retrieve()
calls theIPRBProxy.sol::execute()
which performs a delegate call to withdraw tokens. In the IPRBProxy.sol from Etherscan execute function's Natspec states thatIt returns the data it gets back, and bubbles up any potential revert
. This means that, if the target contract's function being called through execute encounters a revert, that revert is not caught or handled within the execute function itself. Instead, it is allowed to propagate back to the caller of the execute function, and the caller can decide how to handle or react to the revert.Impact
The retrieval and distribution of TELCOIN will be inaccurate hence, causing users to lose their TELCOIN rewards.
Code Snippet
https://github.com/sherlock-audit/2024-01-telcoin/blob/main/telcoin-audit/contracts/sablier/core/CouncilMember.sol#L270-L279
Tool used
Manual Review
Recommendation
(bytes memory response)
receivedThe text was updated successfully, but these errors were encountered: