XDZIBEC-wrap function does not validate the amount parameteR
Summary
The wrap function in the PTokenInterface interface does not validate the amount parameter,it's means that an attacker could call the wrap function and specify an amount that is greater than the amount of underlying tokens that the attacker has. This would allow the attacker to mint new PTokens without having the underlying tokens to back them up.
Vulnerability Detail
interface PTokenInterface is IERC20 {
function getUnderlying() external view returns (address);
function wrap(uint256 amount) external;
function unwrap(uint256 amount) external;
function absorb(address user) external;
}
There is a vulnerability in the PTokenInterface interface, so the problem is in the amount parameter. The amount parameter is the amount of underlying tokens that will be wrapped the amount parameter is not validated. This means that an attacker could call the wrap function and specify an amount that is greater than the amount of underlying tokens that the attacker has.
the wrap function is responsible for wrapping underlying tokens into PTokens.
Impact
An attacker could exploit the vulnerability and mint a large number of PTokens without having the underlying tokens to back them up.
Validate the amount parameter before minting new PTokens. this prevents an attacker from minting new PTokens without having the underlying tokens to back them up.
XDZIBEC
high
XDZIBEC-wrap function does not validate the amount parameteR
Summary
The
wrap
function in thePTokenInterface
interface does not validate theamount
parameter,it's means that an attacker could call thewrap
function and specify anamount
that isgreater
than theamount
of underlyingtokens
that the attacker has. This would allow the attacker tomint
newPTokens
without having the underlyingtokens
to back them up.Vulnerability Detail
PTokenInterface
interface, so the problem is in theamount
parameter. The amount parameter is theamount
of underlyingtokens
that will bewrapped
theamount
parameter is not validated. This means that an attacker could call thewrap
function and specify anamount
that is greater than theamount
of underlyingtokens
that the attacker has. thewrap
function is responsible forwrapping
underlyingtokens
intoPTokens
.Impact
mint
a large number ofPTokens
without having the underlying tokens to back them up.Code Snippet
Tool used
Manual Review
Recommendation
amount
parameter before minting newPTokens
. this prevents an attacker from minting newPTokens
without having the underlyingtokens
to back them up.