Open code423n4 opened 1 year ago
SantiagoGregory marked the issue as disagree with severity
Since this is a view-only function not used anywhere else in the protocol, downgrading to low severity.
Picodes changed the severity to QA (Quality Assurance)
Picodes marked the issue as grade-a
Lines of code
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/LienToken.sol#L550-L560
Vulnerability details
Vulnerability Detail
function
LienToken.getAmountOwingAtLiquidation()
is used to retrieve a specific point by its lienId. Its implementation is as follow:As we can see this function will return the
amountOwed
of the auction data at positionstack.point.lienId
of stack. Sincestack.point.lienId
in other functions likeLienToken.validateLien()
is calculated aslienId = uint256(keccak256(abi.encode(lien)))
, it can be much larger than the stack size. So obviously thisstack.point.lienId
doesn't have the same purpose as the lienId the protocol used. It will make users who want to integrate with Astaria into their contracts confuse about the input parameter when using this function. It can incur the loss for the user / partner when use the function in a wrong way.Impact
Tool used
Manual Review
Recommendation
Modify function as follow: