Skip to content

Code4rena

Canto

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

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

Disclosed reports

Newest first. Only what Canto chose to make public.

DoS

An attacker can DoS a coinswap pool

The coinswap module's balance retrieval iterates over all token balances, so an attacker can send many token denominations to a pool's escrow address, causing gas exhaustion and failure of liquidity operations. This could disrupt swaps and liquidity removal, though the impact is limited to auto-swap during onboarding.

Canto

Medium
Business logic

MsgSwapOrder will never work for Canto nodes

The MsgSwapOrder message lacks a signer annotation, so Canto nodes cannot identify who signed it and the message never works. This prevents arbitrage that would balance pool prices, potentially causing the onboarding swap to fail its slippage check.

Canto

Medium
Business logic

Govshuttle module does not register its transaction MsgServer

The govshuttle module did not register its message server, so governance proposals containing LendingMarketProposal or TreasuryProposal messages would fail to execute. An attacker could not exploit this directly, but legitimate governance actions would be ineffective.

Canto

Medium
Business logic

Native gas tokens can become stuck in ASDRouter contract

The ASDRouter contract does not refund excess native gas tokens (CANTO) sent with a transaction when an asD redemption succeeds, leaving the surplus stuck in the contract. An attacker could deliberately send extra value to cause funds to be permanently locked, violating the protocol's invariant that the router's native balance should always be zero.

Canto

High
Business logic

Removing token from the whitelist may cause DoS due to limited USDC amount

The withdraw function only allows withdrawing a USDC version that is currently whitelisted, so if the owner removes a version from the whitelist, the tokens backed by that version can no longer be withdrawn. Holders of the remaining whitelisted version could then drain its balance, leaving other users unable to withdraw.

Canto

Medium
DoS

asdRouter.sol is at risk of DOS due to vulnerable implementation of NOTE address

The router contract stored the NOTE token address once at deployment instead of reading it dynamically from the cNOTE contract, so it effectively hardcoded the address. If NOTE is redeployed at a new address, the swap and cross-chain compose functions would break, causing a denial of service.

Canto

Medium
Audit finding

secRewardsPerShare Insufficient precision

The secRewardsPerShare calculation uses insufficient precision, causing rounding down to zero for typical market supplies. This means secondary rewards are effectively not accumulated, leading to a loss of yield for participants.

Canto

Medium
Business logic

update_market() market weight incorrect

The reward calculation in update_market() used block numbers as the time parameter for gaugeController.gauge_relative_weight_write(), but that function expects a timestamp. This mismatch caused the weight to be looked up for an epoch in 1970, resulting in near-zero rewards and preventing users from earning their fair share.

Canto

High
Audit finding

Loss of precission when calculating the accumulated CANTO per share

The update_market function divides by 1e18 before multiplying by 1e18, causing rounding down and reducing the rewards users receive. An attacker could not directly exploit this, but it leads to a small loss of yield for users.

Canto

Medium
Business logic

update_market() nextEpoch calculation incorrect

The update_market() function calculates nextEpoch incorrectly when crossing an epoch boundary, using i + BLOCK_EPOCH instead of epoch + BLOCK_EPOCH. This causes accCantoPerShare to be over- or under-calculated, potentially increasing allocated rewards.

Canto

High
Business logic

No slippage protection for Market functions

The Market contract's buy and sell functions lack slippage protection, so the price can change between when a user submits a transaction and when it executes. An attacker can sandwich the user's transaction to profit at the user's expense.

Canto

Medium
Business logic

Users will lose rewards when buying new tokens if they already own some tokens

When a user buys additional tokens of a share they already hold, the buy function updates their reward checkpoint after splitting the new fee, so their existing tokens never earn a share of that fee. The buyer permanently loses the reward they should have received on their old holdings, while other holders gain slightly more.

Canto

Medium
Access control

The Liquidity mining callpath sidecar owner can pull native tokens from the Dex

The liquidity mining reward-setting functions did not verify that the caller sent the native tokens corresponding to the declared weekly reward amount. The owner could therefore set rewards that draw on native tokens already held by the DEX, using those funds to pay rewards instead of supplying new tokens.

Canto

Medium
Business logic

Rewards cannot be transferred when calling protocol command

The protocol command entry point in LiquidityMiningPath is not marked payable, so any call that sends a positive value is rejected. This prevents rewards from being transferred when setting them up through the intended command flow.

Canto

Medium
Business logic

Potential risk of using swappedAmount in case of swap error

The onboarding module ignores errors from the coinswap keeper and still uses the returned swapped amount to compute how many IBC vouchers to convert. If a future change makes the swap function return a non-zero amount alongside an error, the module would convert the wrong number of vouchers, leaving some unconverted.

Canto

Medium
Business logic

Pre-defined limit is different from the spec

The smart contract's swap limit for ETH was set to 0.1 ETH instead of the specified 0.01 ETH, allowing swaps up to ten times larger than intended. An attacker could exploit this to manipulate pools and cause larger losses than the risk management intended.

Canto

High
DoS

getUnderlyingPrice() should return 0 when errored

The oracle's getUnderlyingPrice function reverts on errors instead of returning 0 as the Comptroller expects, causing unexpected errors for consumers. An attacker could trigger these reverts to disrupt the lending market's price retrieval.

Canto

Medium
DoS

unbounded loop length dos

The setPeriodSize function loops over every entry in the allPairs array, and anyone can grow that array by calling createPair. By spamming createPair, an attacker could make the loop exceed the block gas limit so that setPeriodSize always reverts, stalling that admin function.

Canto

Medium
Business logic

evm_hooks ignores some important errors

The evm_hooks processEvents function ignores errors when handling Turnstile events, so if one event fails, subsequent events are skipped and contracts or NFTs may never receive CSR fees. An attacker could cause a transaction with multiple events to fail silently, leaving contracts unregistered in the CSR store.

Canto

Medium
DoS

PostTxProcessing can revert user transactions not interacting with Turnstile

The PostTxProcessing hook in the CSR module returns an error when any CSR-specific operation fails, which causes the entire user transaction to be reverted even if it did not interact with the Turnstile contract. An attacker could trigger such errors (e.g., by causing zero fees due to rounding) to revert unrelated transactions.

Canto

Medium
Business logic

A registered contract won’t earn fees if _recipient is a fresh address

The register function on the application layer accepts any non-zero recipient address, but the consensus layer rejects fresh accounts, so the transaction succeeds while the contract is never registered. An attacker could cause a user to register with a fresh address, permanently preventing the contract from earning fees.

Canto

High
Crypto

Calculated token0TVL may be zero under certain scenarios

Integer division inside brackets was performed before multiplication when computing token0TVL, so the result could round down to zero for tokens with many decimals. An attacker could then obtain a wrong, near-zero LP token price from the oracle.

Canto

Medium