Boost _ Folks Finance 33880 - [Smart Contract - Medium] Front-Running Vulnerability in createUserLoa
Description
Brief/Intro
Vulnerability Details
contract LoanManager is ReentrancyGuard, ILoanManager, LoanManagerState {
...
function createUserLoan(bytes32 loanId, bytes32 accountId, uint16 loanTypeId, bytes32 loanName)
external
override
onlyRole(HUB_ROLE)
nonReentrant
{
// check loan types exists, is not deprecated and no existing user loan for same loan id
if (!isLoanTypeCreated(loanTypeId)) revert LoanTypeUnknown(loanTypeId);
if (isLoanTypeDeprecated(loanTypeId)) revert LoanTypeDeprecated(loanTypeId);
if (isUserLoanActive(loanId)) revert UserLoanAlreadyCreated(loanId);
// create loan
UserLoan storage userLoan = _userLoans[loanId];
userLoan.isActive = true;
userLoan.accountId = accountId;
userLoan.loanTypeId = loanTypeId;
emit CreateUserLoan(loanId, accountId, loanTypeId, loanName);
}
...
}Impact Details
Recommendation
References
Proof of concept
Proof of Concept (POC)
PreviousBoost _ Folks Finance 33870 - [Smart Contract - Low] convToRepayBorrowAmount calculation is incorrecNextBoost _ Folks Finance 33885 - [Smart Contract - Low] Incorrect prices will be returned if the NodeTy
Last updated
Was this helpful?