Skip to content

Code4rena

Swivel v3 contest

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

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

Disclosed reports

Newest first. Only what Swivel v3 contest chose to make public.

Access control

ERC20 Incorrect check on returnedAddress in permit() results in unlimited approval of zero address

The permit() function in a Solmate-derived ERC20 contract incorrectly allowed a recovered address of zero to pass the signature check, so anyone could grant themselves unlimited allowance from the zero address. This could let an attacker transfer tokens held at the zero address and potentially drain a protocol, though the report notes the current implementation does not send tokens to the zero address when burning.

Swivel v3 contest

Medium
Smart contracts

Interface definition error

The MarketPlace contract calls a function named authRedeem on the Swivel contract, but Swivel only implements authRedeemZcToken. This mismatch causes the authRedeem path to fail permanently, breaking EIP-5095 compliance, though an alternate redemption route exists.

Swivel v3 contest

Medium
Access control

VaultTracker has the wrong admin

The VaultTracker contract set its admin to the Creator contract's address rather than the Marketplace's address, because it used msg.sender during a nested call. The Creator contract cannot and is not meant to interact with VaultTracker, so the intended admin (Marketplace) lacks admin rights.

Swivel v3 contest

Medium
Business logic

unpaused(p) modifier missing in authRedeem function

The authRedeem function in a smart contract lacks the unpaused(p) modifier, so users can redeem zcTokens and withdraw underlying assets even when the market is paused. An attacker could bypass the admin's pause to withdraw funds during a paused state.

Swivel v3 contest

Medium
Smart contracts

Should use >= instead of >

A comparison in the VaultTracker contract used a strict greater-than instead of greater-than-or-equal, so removing or transferring notional could leave a tiny dust amount behind. An attacker could repeatedly trigger this to leak small amounts of value from the contract.

Swivel v3 contest

Medium
Smart contracts

VaultTracker miscalculates compounding interest

VaultTracker calculated new interest only on the notional amount, ignoring previously accrued redeemable interest, so nToken holders received less yield than they should. An attacker could not directly steal funds, but the protocol leaked value to other users over time.

Swivel v3 contest

Medium
Business logic

Error in allowance logic

The allowance check in the ZcToken contract was inverted, so a non-owner could never withdraw or redeem tokens on behalf of the owner. An attacker could not exploit this to steal funds, but the intended delegation feature was completely broken.

Swivel v3 contest

Medium
Business logic

Yearn vault integration is broken

The Compounding library calls a non-existent 'underlying' function on Yearn vaults, causing a revert. This prevents creating a MarketPlace associated with a Yearn vault, breaking the stated integration.

Swivel v3 contest

Medium
Access control

Missing event & timelock for critical onlyAdmin functions

Critical admin functions in the VaultTracker contract can change key parameters without emitting events or using timelocks. This means users and other privileged roles cannot detect upcoming changes or react in time, potentially leading to unexpected financial or trust impacts.

Swivel v3 contest

Medium
Business logic

Swivel: implementation for initiateZcTokenFillingZcTokenExit is incorrect

The function initiateZcTokenFillingZcTokenExit incorrectly transfers the fee to the maker instead of to Swivel, and also transfers the wrong amount of underlying tokens. An attacker could exploit this to avoid paying fees or cause loss of funds.

Swivel v3 contest

Medium
Business logic

transferNotionalFrom doesn’t check from != to

The transferNotionalFrom function in VaultTracker.sol uses temporary variables to store balances, and if the from and to addresses are the same, the balance of from is overwritten by the balance of to, increasing both balances without decreasing any, effectively creating money. An attacker could call this function via transferVaultNotional to inflate their balance.

Swivel v3 contest

High
Business logic

fee-on-transfer underlying can cause problems

The Swivel protocol assumes that token transfers always deliver the exact amount specified, so it fails with fee-on-transfer tokens. If a fee is activated on an underlying token like USDT, functions such as redeeming the underlying would revert, blocking users from accessing their funds.

Swivel v3 contest

Medium
Access control

Admin is a single-point of failure without any mitigations

The admin role in the Swivel, Marketplace, and VaultTracker contracts has absolute power with no ability to transfer or renounce it. If the admin key is lost or compromised, there is no way to recover or change control, making it a single point of failure.

Swivel v3 contest

Medium
Business logic

Previously created markets can be overwritten

The createMarket function lacks a check for an existing market, allowing a previously created market for the same underlying and maturity to be overwritten. An attacker could accidentally or maliciously replace a legitimate market, potentially disrupting the protocol.

Swivel v3 contest

Medium
Business logic

Unsafe handling of underlying tokens

The contract does not check the return value of ERC20 transferFrom calls, so a token that returns false instead of reverting can be used to initiate a trade without actually transferring the underlying tokens.

Swivel v3 contest

High
Business logic

Swivel: Taker is charged fees twice in exitVaultFillingVaultInitiate

In the exitVaultFillingVaultInitiate function, the taker is charged a fee twice: the maker transfers less than the full premium to the taker, and the taker is then also charged a fee, so the taker's net balance is the premium minus twice the fee. The maker ends up with a higher balance than expected and the taker cannot recover the extra fees.

Swivel v3 contest

High
Smart contracts

return value of 0 from ecrecover not checked

The smart contract did not check whether the ecrecover function returned zero on error, so an attacker could supply an invalid signature and set the maker address to zero to bypass signature validation. This could allow illegal and unexpected transactions.

Swivel v3 contest

High