Skip to content

Code4rena

Papr contest

Every publicly disclosed report for Papr contest and what kind of bugs they were.

disclosed reports
22
most reported class
Business logic
bug classes found
4
first disclosure
2022
Find Papr contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Papr contest chose to make public.

Business logic

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 function purchaseLiquidationAuctionNFT() incorrectly sets maxDebtCached to the full debt when the auctioned NFT is the user's last collateral, causing the entire payment to be treated as excess and a 10% liquidation penalty to be taken from the whole amount. This means the user loses 10% of the auction price instead of 10% of the excess over debt, resulting in fund loss.

Papr contest

Medium
Business logic

Incorrect usage of safeTransferFrom traps fees in Papr Controller

The Papr Controller contract uses safeTransferFrom to move Papr tokens out of itself, but it never approves those transfers, so the calls revert. This traps auction proceeds in the contract and prevents the owner or DAO from collecting fees.

Papr contest

Medium
Race condition

Stealing fund by applying reentrancy attack on removeCollateral , startLiquidationAuction , and purchaseLiquidationAuctionNFT

The protocol's functions for removing collateral, starting a liquidation auction, and purchasing an auctioned NFT lacked reentrancy protection, allowing a malicious contract to reenter during NFT transfer callbacks. An attacker could borrow the maximum amount, remove most collateral, auction the last NFT, buy it, and have remaining debt wiped, stealing funds.

Papr contest

High
Business logic

PaprController pays swap fee in buyAndReduceDebt , not user

The buyAndReduceDebt function in PaprController collects the swap fee from the contract itself rather than from the caller, because it uses transfer instead of transferFrom. This causes the transaction to revert when a fee is set, and could allow any mistakenly sent underlying tokens to be transferred out.

Papr contest

Medium
DoS

Grieving attack by failing user’s transactions

An attacker can front-run a user's debt repayment transaction by repaying a tiny amount of that user's debt first, causing the user's transaction to fail with an underflow error. This prevents the user from fully repaying their debt.

Papr contest

Medium
Business logic

Borrowers may earn auction proceeds without filling the debt shortfall

When a vault's last collateral was auctioned, the contract wrote off the remaining debt as a shortfall even though another collateral was still being auctioned. The borrower could then receive the proceeds of the second auction as a payout instead of those funds covering the written-off debt.

Papr contest

High
Business logic

PaprController.buyAndReduceDebt: msg.sender can lose paper by paying the debt twice

The buyAndReduceDebt function sends swapped papr tokens to the account address but burns papr tokens from the caller, so the caller pays twice while the account receives the tokens and debt reduction. An attacker could cause a caller to lose funds if the caller has enough papr tokens to burn.

Papr contest

Medium
Business logic

Missing deadline checks allow pending transactions to be maliciously executed

The PaprController contract lacks a deadline parameter for swaps on Uniswap V3, so pending transactions can be executed much later at outdated prices. An attacker, such as an MEV bot, could exploit this to sandwich the transaction and profit from the user's loss.

Papr contest

Medium
Business logic

Last collateral check is not safe

The liquidation purchase function decided whether an NFT was a vault's last collateral by checking whether the cached collateral value was zero, rather than checking the NFT count. If the external price oracle returned zero while the vault still held NFTs, the code would treat it as the last collateral and wipe the remaining debt, letting the owner withdraw the other NFTs for free.

Papr contest

Medium
Business logic

Users may be liquidated right after taking maximal debt

The protocol allowed users to borrow up to the maximum loan-to-value (LTV) ratio, but positions became liquidatable as soon as debt reached that same maximum LTV. An attacker could borrow the maximum amount and then immediately liquidate the position in the same block, causing the user to lose funds and potentially creating bad debt for the protocol.

Papr contest

High
Access control

Collateral NFT deposited to a wrong address, when transferred directly to PaprController

The PaprController contract's onERC721Received hook incorrectly uses the first argument (the caller) as the token owner instead of the second argument (the actual owner). When an approved address or operator transfers an NFT to the contract, the NFT is credited to the wrong vault, causing the real owner to lose their collateral.

Papr contest

High
Business logic

Borrowers lose funds if they call repayAndCloseLoan instead of closeLoan

The repayAndCloseLoan function does not check that a loan has been matched with a lender, so calling it on an unmatched loan causes the borrower to transfer a large interest amount and the minimum loan amount to the zero address. A borrower who has approved the contract could lose funds if they call this function instead of closeLoan.

Papr contest

Medium
Business logic

mintBorrowTicketTo can be a contract with no onERC721Received method, which may cause the BorrowTicket NFT to be frozen and put users’ funds at risk

The mint function for the BorrowTicket NFT uses _mint instead of _safeMint, so if the recipient is a contract that cannot handle ERC721 tokens, the NFT may become stuck and the user's funds could be lost. An attacker could exploit this by setting a contract address that cannot receive NFTs as the mintBorrowTicketTo parameter, causing the ticket to be frozen.

Papr contest

Medium
Business logic

requiredImprovementRate can not work as expected when previousInterestRate less than 10 due to precision loss

The buyout check in the NFT loan facilitator used integer division to compute the required improvement, so when the previous interest rate was below 10 and the required improvement rate was 100, rounding down let a new lender match the existing rate instead of improving it. An attacker could therefore buy out a loan without offering better terms.

Papr contest

Medium
Race condition

Borrower can be their own lender and steal funds from buyout due to reentrancy

A borrower could lend to their own loan and then, via a reentrant call during the buyout process, repay and close the loan before the lend ticket is transferred to the new lender. This allowed the borrower to keep the NFT, the loan amount, and accrued interest, effectively stealing funds from the new lender.

Papr contest

High
Race condition

currentLoanOwner can manipulate loanInfo when any lenders try to buyout

The current loan owner can re-enter the lend function during a buyout because the loan asset token triggers a callback, allowing them to overwrite the loan terms with unfavourable values. A lender attempting to buy out the loan could end up with a manipulated loan that cannot be corrected.

Papr contest

High
Business logic

Might not get desired min loan amount if _originationFeeRate changes

The minimum loan amount set by a borrower is interpreted as the pre-fee amount, so if the admin increases the origination fee after the loan is created, the borrower receives less than the intended minimum. This could leave the borrower with insufficient funds for their needs.

Papr contest

Medium
Business logic

Protocol doesn’t handle fee on transfer tokens

The protocol did not account for ERC20 tokens that charge a fee on transfer, so when a loan was funded with such a token, the second transfer could fail or the facilitator could lose funds. An attacker could not directly exploit this, but it could break core loan functionality or cause a loss for the lender or borrower.

Papr contest

Medium
Business logic

Can force borrower to pay huge interest

The loan amount in the NFT loan facilitator acts as a minimum, so a lender can match a borrower's requested loan with a much larger amount. The borrower then owes interest on the full larger amount, potentially forcing them to pay far more interest than intended or risk losing their collateral.

Papr contest

High