-
Notifications
You must be signed in to change notification settings - Fork 3
TrungOre - Fee in contract FixedStrikeOptionTeller
can be bypassed by the protocol integrate with Bond
#44
Comments
Escalate Evidence supporting the claim that the FixedStrikeOptionTeller is controlled by the Bond team can be found in the Sherlock Discord community:
Furthermore, the OTLM contract can be deployed by anyone using the OTLMFactory. While users are responsible for interacting with the "trusted" OTLM, the issue describes how the OTLM doesn't harm users but instead creates a backdoor to help them bypass fees from the Bond team, resulting in a loss of fees for Bond. I believe this issue is valid and cause the loss of fee for bond protocol. |
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. |
Bringing for sponsor review, the recommendation maybe valuable, will sync the protocol's thoughts |
Comment from sponsor: This is by design. We have the exclusion for the receiver so that they can “reclaim” tokens that they don’t distribute before expiry if needed. We only take a fee on a successful exercise |
Escalate If every protocol were to implement a similar backdoor as described in the issue, it would result in no fees being accrued for the bond team, leading to a loss of funds.
--> Hence, based on Sherlock's judging criteria, it remains a valid and significant issue. If the protocol still wishes to exclude fees for the "receiver," one recommendation is to designate the "receiver" as an externally owned account (EOA) wallet and require |
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. |
I think this is a design choice, and therefor a low in regards to sherlock rules. |
Hi @Oot2k, I respect your comment regarding my escalation. Moreover, as I described in the issue, the bond protocol will lose their fee. So it's the high impact, not just low. |
In Y2k contest issue 75, the flaw is in the code itself, there is a code place where the smart contract does not charge fee While in the finding, it has a strong assumption in the future integration, which is not in scope https://docs.sherlock.xyz/audits/judging/judging
The external receiver contract maybe take the option token and call exercise directly to pull the payout token to himself or he can choose to not exercise token wait for the option token to expire and he call reclaim. so he does not pay the protocol and does not pay the sender as well Just want to put the sponsor's feedback screenshot here: |
Why do u think it's a "future integration" ? It's obvious that the Bond protocol was designed for another third party to integrate with which is not a "integration" at all. I mean the third party here is "user", not any specific integration, i think u have a misunderstanding here.
I believe that the future integration from the sherlock here is about the change of code when the bond protocol have a implementation that interact directly with a specified protocol (like Aave, Compound, ...) and if the integrated protocol change / update the codebase, it won't count.
Who is "he" here ? If u mean "he" is the "receiver" contract, so why the receiver contract "wait for the option token to expire and call reclaim" ? If the "receiver" contract contain that functionality, the sender won't use it anw, because they will lose their benefit of optionToken ? |
Tagging @Oighty to have a look at this issue. |
The purpose of the receiver being able to "exercise" early is so that they can "reclaim" collateral for option tokens they still hold without waiting for them to expire (as is required in the reclaim function). We don't want to take a fee on option tokens that are not used. |
Hi @Oighty, |
@WelToHackerLand thanks for the clarification. We don't view this as any more risky than someone forking the open source contracts. Appreciate the heads up, but we don't plan to remediate. |
Result:
|
Escalations have been resolved successfully! Escalation status:
|
TrungOre
high
Fee in contract
FixedStrikeOptionTeller
can be bypassed by the protocol integrate with BondSummary
See the detail
Vulnerability Detail
The
FixedStrikeOptionTeller.exercise()
function is employed to exercise anoptionToken
by supplying the necessary quote tokens. In return, the sender receives a specific quantity of payout tokens. Within this function, the sender incurs a fee, which amounts toprotocolFee / FEE_DECIMALS
of the quote tokens they receive.However, there is an exception when the sender is the same as the receiver; in this case, the fee will be skipped.
It is important to note that the ownership of the
FixedStrikeOptionTeller
contract lies with Bond. However, theOTLM
contracts can be generated by a third party for the distribution of their tokens. This third party has the ability to deploy a contract and designate it as thereceiver
for theOTLM
contracts. By creating thisreceiver
contract, the third party establishes a potential loophole for their users to circumvent Bond's protocol fee when exercising theoptionToken
. This can be achieved by incorporating a function within thereceiver
contract to interact with theFixedStrikeOptionTeller.exercise()
function. The process of this function can be described as follows:optionToken
from sender toreceiver
contract.quoteToken
from sender toreceiver
contract.FixedStrikeOptionTeller.exercise()
.payoutToken
fromreceiver
contract to the sender.Impact
There won't be any fee accured for the bond protocol
Code Snippet
https://github.com/sherlock-audit/2023-06-bond/blob/main/options/src/fixed-strike/FixedStrikeOptionTeller.sol#L341-L361
Tool used
Manual Review
Recommendation
Consider to charge fee when calling function
FixedStrikeOptionTeller.exercise()
even the sender is thereceiver
.The text was updated successfully, but these errors were encountered: