Putty contest - itsmeSTYJ's results

An order-book based american options market for NFTs and ERC20s.

General Information

Platform: Code4rena

Start Date: 29/06/2022

Pot Size: $50,000 USDC

Total HM: 20

Participants: 133

Period: 5 days

Judge: hickuphh3

Total Solo HM: 1

Id: 142

League: ETH

Putty

Findings Distribution

Researcher Performance

Rank: 50/133

Findings: 2

Award: $89.02

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
duplicate
2 (Med Risk)

Awards

41.8933 USDC - $41.89

External Links

Lines of code

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L268

Vulnerability details

Impact

The permissionless nature of Putty will encourage bait and switch scams. The malicious user will first create a token with a broken transfer function (reverts if certain conditions are met) and provide liquidity for it on a DEX. This user will then make a "fat fingered" options order (even with very reasonable parameters to make it look legitimate) to entice takers to fill the short side of it. Non technical takers will attempt to buy said these malicious tokens off the DEX only to realise that they cannot be transferred out of their addresses.

The order is effectively a honey pot to trap innocent users as the malicious user is able to withdraw the funds from the DEX once it is done..

  • Since the owner role already exists, leverage on it to whitelist certain ERC20 or ERC721 addresses that can be used to trade on Putty. Think Pareto's principle!

#0 - outdoteth

2022-07-07T13:34:46Z

Duplicate: Setting malicious or invalid erc721Assets, erc20Assets or floorTokens prevents the option from being exercised: https://github.com/code-423n4/2022-06-putty-findings/issues/50

Lines of code

https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L287

Vulnerability details

Impact

A malicious maker who:

  1. won't exercise their long option
  2. is willing to have their assets "stuck"

can intentionally create a "fat fingered" long option (i.e. very profitable for any taker to fill the short side) with 9999 days on the duration and 0 premiums. An opportunistic but amateur user might be tempted to fill the short side. This will lead to their funds being stuck for 27 years since the maker has no intention of exercising his options.

Note that a competitor platform might take this approach to create FUD / DOS users of Putty.

  • Use a more reasonable / common values when checking the duration of the order to be filled.
  • Add more / improve heuristics to ensure that the order being filled is a "sane" order.
  • Indicate clearly on the UI of any potential anomalies

#0 - outdoteth

2022-07-05T17:54:53Z

Options with durations of 27 years are valid and are expected behaviour. The example provided is not an issue but a feature showing the platform working correctly.

#1 - HickupHH3

2022-07-14T06:05:43Z

Agree with sponsor; maybe 27 years might seem too long, but if it's intended, then it isn't an issue but a feature :p

#2 - HickupHH3

2022-07-14T06:17:05Z

Warden has no QA, this shall be the primary

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter