Skip to content

Code4rena

Putty

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

disclosed reports
20
most reported class
Business logic
bug classes found
5
Find Putty on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Putty chose to make public.

Smart contracts

Use of Solidity version 0.8.13 which has two known issues applicable to PuttyV2

The smart contract project PuttyV2 used Solidity version 0.8.13, which contains two known compiler bugs: one in ABI encoding and one in the optimiser's handling of inline assembly. An attacker could potentially exploit these bugs to cause incorrect behaviour in the contract, though the report does not demonstrate a concrete exploit.

Putty

Medium
Business logic

Zero strike call options will avoid paying system fee

The fee for options was calculated as a fraction of the strike price, so zero-strike calls incurred no fee and deep out-of-the-money calls incurred disproportionately high fees. An attacker could avoid paying system fees by using zero-strike call options.

Putty

Medium
Business logic

Order duration can be set to 0 by Malicious maker

A maker could create an order with a zero duration, causing it to expire immediately after a taker fills it. The taker would then be forced to withdraw at a loss due to fees on the strike price.

Putty

Medium
Business logic

fee can change without the consent of users

Fees are applied only when a user withdraws, so the contract owner could raise the fee after an order was agreed and filled, and users would then pay the higher rate on withdrawal. This could cause users to lose funds they expected to keep, since they would not have entered the order at the higher fee.

Putty

Medium
Access control

Putty position tokens may be minted to non ERC721 receivers

The Putty protocol mints ERC721 position tokens using an unsafe mint function that does not verify the recipient can handle ERC721 tokens. If a maker or taker is a contract unable to receive ERC721 tokens, their position tokens may become locked and nontransferable, preventing them from exercising or withdrawing assets.

Putty

Medium
Race condition

The contract serves as a flashloan pool without fee

The PuttyV2 contract allows a malicious contract to act as both maker and taker in a fillOrder, using a custom ERC20 token to pay the fee and reentering to exercise an option, thereby obtaining assets without paying a real fee. This enables flashloan-like access to the contract's assets for profit.

Putty

Medium
Business logic

Overlap Between ERC721.transferFrom() and ERC20.transferFrom() Allows order.erc20Assets or order.baseAsset To Be ERC721 Rather Than ERC20

The contract's order parameters allow an ERC721 token address to be used where an ERC20 token is expected because both token standards share the same transferFrom function signature. An attacker could fill an order with an ERC721 as the base or ERC20 asset, causing the NFT to be transferred into the contract but then permanently stuck because the outgoing transfer uses an ERC20-specific function.

Putty

Medium
Business logic

An attacker can create a short put option order on an NFT that does not support ERC721 (like cryptopunk), and the user can fulfill the order, but cannot exercise the option

A short put option order could be created using an NFT that does not implement the ERC721 receiver callback, such as CryptoPunk. A buyer who fulfils the order pays the premium but can never exercise the option because the transfer call fails, letting the attacker keep the premium and recover the asset after expiry.

Putty

Medium
Business logic

fillOrder() and exercise() may lock Ether sent to the contract, forever

The fillOrder() and exercise() functions are payable and accept Ether even when the code path does not require it, so any Ether sent is locked in the contract forever. An attacker could not directly exploit this, but a user could accidentally lose funds by sending Ether when it is not needed.

Putty

Medium
Business logic

Put options are free of any fees

The protocol failed to deduct fees when a put option was exercised, so put options were free of fees. An attacker could exercise put options without paying the protocol fee, causing the protocol to leak value.

Putty

Medium
DoS

Unbounded loops may cause exercise() s and withdraw() s to fail

The smart contract functions that transfer assets out during exercise or withdrawal loop over an unbounded number of assets, so if gas costs rise or assets are gas-heavy, the transaction can fail due to block gas limit. An attacker could create an order with many assets, causing the buyer to pay the premium but be unable to receive the assets.

Putty

Medium
Business logic

Malicious Token Contracts May Lead To Locking Orders

A maker could include a malicious token contract in an order, which would revert when the taker tried to exercise or withdraw, locking the taker's assets. The attacker could then wait until the option expired or the price moved in their favour before allowing transfers.

Putty

Medium
Business logic

Zero strike call options can be systemically used to steal premium from the taker

The exercise function unconditionally transfers the strike amount, which fails for ERC20 tokens that revert on zero-value transfers. A malicious maker can create a zero-strike call option with such a token, collect the premium, and wait for expiry since the taker cannot exercise, allowing the maker to steal the premium.

Putty

High
Business logic

Create a short call order with non empty floor makes the option impossible to exercise and withdraw

A short call option order with a non-empty floorTokens array cannot be exercised by the taker and cannot be withdrawn by the maker after expiry, locking the maker's ERC20 and ERC721 assets. An attacker could also grief other users by filling a short call with floor tokens that match another user's long call, causing that other user's option to become unexercisable and their funds locked.

Putty

High
Race condition

acceptCounterOffer() May Result In Both Orders Being Filled

The acceptCounterOffer function cancels the original order but does not check if it has already been filled, allowing an attacker to front-run and fill the original order before cancellation. This results in both the original and counter orders being filled, doubling the user's intended leverage.

Putty

High