Hunt prep
Before you test Papr contest
What 22 disclosed reports say about Papr contest: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 16 | 0 | – | – | $0 |
| Race condition lesson | 3 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
| Access control lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
User fund loss because function purchaseLiquidationAuctionNFT() takes extra liquidation penalty when user’s last collateral is liquidated, (set wrong value for maxDebtCached when isLastCollateral is true)
The code should be fixed by setting maxDebtCached to 0 when isLastCollateral is true, so that only the excess over debt is subject to penalty.
Disclosed
-
Grieving attack by failing user’s transactions
The function should cap the repayment amount at the current debt before subtracting, so that overpayment does not cause an underflow.
Disclosed
-
Borrowers may earn auction proceeds without filling the debt shortfall
The shortfall should be recorded when debt is written off and filled from later auction proceeds before any excess is paid to the borrower; the project also suggested the last-collateral check should account for other ongoing auctions.
Disclosed
-
Disabled NFT collateral should not be used to mint debt
The project should add a check in the debt increase function to revert if the collateral is not allowed.
Disclosed
-
PaprController.buyAndReduceDebt: msg.sender can lose paper by paying the debt twice
The swapped papr tokens should be sent to the caller instead of the account, so they can be burnt from the caller.
Disclosed
-
Missing deadline checks allow pending transactions to be maliciously executed
A deadline parameter should be added to all functions that perform swaps on the user's behalf.
Disclosed
-
Last collateral check is not safe
The check should compare the stored NFT count for the vault against zero instead of relying on the cached collateral value.
Disclosed
-
Users may be liquidated right after taking maximal debt
The protocol should use a liquidation LTV that is higher than the maximum borrow LTV, or only allow liquidation when debt exceeds the maximum.
Disclosed
-
Collateral NFT deposited to a wrong address, when transferred directly to PaprController
The parameters in the onERC721Received function should be swapped so that the second argument (from) is used as the owner.
Disclosed
-
Incorrect usage of safeTransferFrom traps fees in Papr Controller
The contract should call transfer(to, amount) instead of safeTransferFrom.
Disclosed
-
PaprController pays swap fee in buyAndReduceDebt , not user
The code should use safeTransferFrom to collect the fee from the caller instead of transfer from the contract.
Disclosed
-
requiredImprovementRate can not work as expected when previousInterestRate less than 10 due to precision loss
The check should round the required improvement up (for example with a ceiling division helper) so small rates cannot round down to zero.
Disclosed
-
Borrower can be their own lender and steal funds from buyout due to reentrancy
The fix is to transfer the lend ticket to the new lender before transferring funds to the original lender, and/or to use a reentrancy guard; the report was resolved.
Disclosed
-
currentLoanOwner can manipulate loanInfo when any lenders try to buyout
The lend function should be protected with a reentrancy guard, such as OpenZeppelin's nonReentrant modifier.
Disclosed
-
Might not get desired min loan amount if _originationFeeRate changes
The fix was to store the origination fee rate in the loan struct at origination, ensuring the borrower gets the fee rate present when they created the loan.
Disclosed