XO-_payoffFromContract() function could allow for invalid Fixed18 values to be returned
Summary
The vulnerability is in the _payoffFromContract() function, the payoff function on the underlying contract returns a valid Fixed18 value. This means that an attacker could create a contract that implements the IContractPayoffProvider interface and returns an invalid Fixed18 value from the payoff function.
The vulnerability exist in the _payoffFromContract() function. This function is used to get the payoff from a contract that implements the IContractPayoffProvider interface. The vulnerability is that the function does not check to see if the payoff function on the underlying contract returns a valid Fixed18 value. This means that an attacker could create a contract that implements the IContractPayoffProvider interface and returns an invalid Fixed18 value from the payoff function. If the attacker is able to do this, then the _payoffFromContract() function will return an invalid Fixed18 value, which could lead to unintended consequences.
Impact
an attacker can exploit the vulnerability and cause the contract to lose funds or to give the attacker control of the contract.
XDZIBEC
high
XO-
_payoffFromContract()
function could allow for invalidFixed18
values to be returnedSummary
_payoffFromContract()
function, thepayoff
function on the underlying contract returns a validFixed18
value. This means that an attacker could create a contract that implements theIContractPayoffProvider
interface and returns an invalidFixed18
value from thepayoff
function.Vulnerability Detail
_payoffFromContract()
function. This function is used to get thepayoff
from a contract that implements theIContractPayoffProvider
interface. The vulnerability is that the function does not check to see if thepayoff
function on the underlying contract returns a validFixed18
value. This means that an attacker could create a contract that implements theIContractPayoffProvider
interface and returns an invalidFixed18
value from thepayoff
function. If the attacker is able to do this, then the_payoffFromContract()
function will return an invalidFixed18
value, which could lead to unintended consequences.Impact
Code Snippet
Tool used
Manual Review
Recommendation
_payoffFromContract()
function to see if thepayoff
function on the underlying contract returns a validFixed18
value.