Skip to content

Code4rena

JPEG'd contest

Every publicly disclosed report for JPEG'd contest and what kind of bugs they were.

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

Disclosed reports

Newest first. Only what JPEG'd contest chose to make public.

Smart contracts

Reentrancy issue in yVault.deposit

The deposit function in yVault caches the balance before calling token.transferFrom, allowing a reentrant token to manipulate share minting. An attacker could split deposits and reenter to mint excess shares, then withdraw for a profit and repeat until the vault is drained.

JPEG'd contest

High
DoS

Setting new controller can break YVaultLPFarming

The farming contract's reward accrual subtracts a stored previous balance from the current balance, and if the vault's controller is changed so that the reported balance drops, the subtraction underflows and reverts. Because withdrawals call the same update first, users can no longer withdraw their funds.

JPEG'd contest

High
Business logic

When _lpToken is jpeg, reward calculation is incorrect

The LPFarming contract allows the owner to add a staking pool whose staking token is the same as the reward token (jpeg). Because reward calculation uses the contract's balance of the staking token, minting rewards inflates that balance and makes the pool's reward per share lower than intended.

JPEG'd contest

Medium
Access control

NFTHelper Contract Allows Owner to Burn NFTs

The NFT helper contract lacks a check that the receiver address is not the zero address, allowing the owner to transfer NFTs to the zero address and burn them permanently. An attacker who gains access to the owner address could also burn NFTs.

JPEG'd contest

Medium
Business logic

reward will be locked in the farm if no LP join the pool at epoch.startBlock

If no liquidity provider deposits at the exact start block of a farming epoch, a portion of the reward tokens remains locked in the contract because the reward calculation only counts from the first deposit block. An attacker cannot directly steal these tokens, but they become permanently stuck, reducing the rewards available to participants.

JPEG'd contest

Medium
Business logic

Controller: Strategy migration will fail

The controller's strategy migration calls a withdraw function that the strategy may have blacklisted, causing the migration to revert. An attacker cannot directly exploit this, but it prevents the protocol from migrating strategies.

JPEG'd contest

High
Access control

The noContract modifier does not work as expected.

The noContract modifier in yVault and yVaultLPFarming uses isContract() to restrict access to externally owned accounts, but isContract() relies on code length, which is zero during contract construction. An attacker could deploy a contract that calls the protected functions from its constructor, bypassing the modifier.

JPEG'd contest

Medium
Audit finding

Division before Multiplication May Result In No Interest Being Accrued

The interest calculation in NFTVault._calculateAdditionalInterest() performs division before multiplication, so the per-second interest can round down to zero and no interest accrues. For tokens with few decimal places, this understates the interest owed.

JPEG'd contest

Medium
Audit finding

Oracle data feed is insufficiently validated.

The smart contract read the oracle's latest answer without checking whether the price was stale or the round complete. An attacker could exploit a stale or incomplete price to cause the contract to return an incorrect value.

JPEG'd contest

Medium
Audit finding

Wrong calculation for yVault price per share if decimals != 18

The yVault contract's getPricePerFullShare function hardcodes 1e18 for decimal scaling, assuming the underlying token always has 18 decimals. For tokens with different decimals, such as USDC with 6, the price per share is calculated incorrectly, potentially causing users or the protocol to lose funds.

JPEG'd contest

Medium
Audit finding

Chainlink pricer is using a deprecated API

The smart contracts used Chainlink's deprecated latestAnswer function to fetch asset prices, which could stop working or return stale data. An attacker could exploit stale prices to manipulate the vault, though the report does not detail a specific attack.

JPEG'd contest

Medium
Business logic

setDebtInterestApr should accrue debt first

The setDebtInterestApr function changes the debt interest rate without first accruing the debt, so the new rate is applied retroactively to the unaccrued period on the next accrue() call. Borrowers can incur more debt than they should.

JPEG'd contest

Medium
Smart contracts

yVault: First depositor can break minting of shares

The first depositor can mint a single share and then donate a large amount to the strategy contract, inflating the share price so that later depositors receive zero shares for their deposits. The attacker can then withdraw both their own and the victims' funds.

JPEG'd contest

High
Smart contracts

Update initializer modifier to prevent reentrancy during initialization

The project used outdated OpenZeppelin contracts with a known reentrancy vulnerability in the initializer modifier, affecting several upgradeable contracts. An attacker could potentially reenter during initialization, though the exact impact is not detailed in the text.

JPEG'd contest

High
Business logic

yVaultLPFarming : No guarantee JPEG currentBalance > previousBalance

The yVaultLPFarming contract assumes that the JPEG balance reported by the vault never decreases, but if it does, a subtraction underflow causes deposits and withdrawals to fail. An attacker could exploit this by triggering a farm migration or strategy change that reduces the balance, locking users' funds.

JPEG'd contest

High
Business logic

Bad debts should not continue to accrue interest

The protocol allows bad debt to keep accruing interest, and when the DAO collects interest it mints new stablecoins. An attacker could exploit this by leaving a position unliquidated, causing unbacked stablecoins to be minted and damaging the stablecoin's authenticity.

JPEG'd contest

High