Skip to content

Code4rena

Kakarot

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

disclosed reports
17
most reported class
Crypto
bug classes found
5
first disclosure
2024
Find Kakarot on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Kakarot chose to make public.

DoS

Account contract does not gracefully handle panics in called contracts

The account contract's execute_starknet_call function uses a Cairo 0 syscall that panics on failure instead of returning a success flag, so any reverting call to a DualVmToken causes an RPC-level revert. An attacker could cause denial of service by triggering such reverts, bypassing EVM-level protective measures.

Kakarot

Medium
Crypto

Incorrect totalsupply value will be returned due to erroneous return data decode implementation

The totalSupply function in DualVMToken incorrectly decodes the return data from a Starknet ERC20 contract as a single uint256 instead of a pair of uint128 values, causing it to return only the lower 128 bits. This can lead to incorrect total supply values, potentially causing fund loss or accounting errors in applications that rely on it.

Kakarot

Medium
Crypto

Three valid signatures for the same message

Kakarot's ecrecover precompile accepted an s value above the secp256k1n curve order and returned a valid address, whereas Ethereum returns address(0). This allowed three different valid signatures for the same message, enabling signature malleability attacks.

Kakarot

High
Crypto

Non-finalized dictionary in RIPEMD160 allows forging of output

The RIPEMD160 precompile in Kakarot did not finalize a dictionary when processing inputs larger than 55 bytes, allowing a malicious prover to insert incorrect values into that dictionary. This enabled forging the hash output for any such input.

Kakarot

High
DoS

Jump in creation code leads to reverting of the starknet transaction

A jump to an offset within the creation code during contract deployment causes the Kakarot EVM to call a zero address, reverting the entire Starknet transaction. An attacker could force a transaction to revert by deploying a contract whose creation code contains a jump to a valid offset.

Kakarot

Medium
Business logic

ExponentiationImpl::pow() returns 0 for 0^0

The ExponentiationImpl::pow() function returns 0 for 0^0 instead of the conventional value 1, because it checks for a zero base before considering a zero exponent. Future code relying on the standard mathematical convention could produce incorrect results.

Kakarot

Medium
Smart contracts

Reentrancy check in account_contract can be easily circumvented

The reentrancy check in the account contract only blocked calls to Kakarot's getter, but an attacker could re-enter the Kakarot EVM by calling another account contract with a signed transaction. This could compromise the integrity of the EVM due to cached data, though the likelihood is extremely low because the function is only accessible via whitelisted contracts.

Kakarot

Medium
Business logic

No way to cancel l1 -< l2 messages

The L1-to-L2 messaging contract lacks a cancellation function, so if a message fails on L2, the user cannot reclaim the fee paid. An attacker could not directly exploit this, but users may permanently lose fees.

Kakarot

Medium
Business logic

Address aliasing is wrongfully applied even to EOAs

Kakarot's L1-to-L2 messaging contract applies address aliasing to all senders, including externally owned accounts (EOAs), whereas the Optimism specification only aliases smart contract senders. This could cause access control checks that expect an EOA's address to fail, breaking functionality.

Kakarot

Medium
Crypto

RIPEMD-160 precompile yields wrong hashes for large set of inputs due to off-by-one error

The RIPEMD-160 precompile in Kakarot used an off-by-one condition when deciding how to pad the final block, so inputs whose length modulo 64 equals 55 were hashed differently from the standard. An attacker could exploit this to produce incorrect hashes, potentially bypassing access control that relies on this precompile.

Kakarot

High
Crypto

Missing constraint in default_dict_copy

The default_dict_copy function in Kakarot's CairoZero code did not enforce that the initial prev_value of a copied dictionary equals the original default value, allowing a malicious prover to set arbitrary default values for transient_storage, storage, and valid_jumpdests. This could let uninitialized keys return attacker-chosen values, potentially leading to unauthorized access to funds or contract state manipulation.

Kakarot

High
Crypto

Prover can cheat in felt_to_bytes_little due to value underflow

The felt_to_bytes_little function in bytes.cairo can be manipulated by a malicious prover to produce arbitrary byte sequences that do not correspond to the input felt, due to a value underflow in the conversion loop. This could allow an attacker to spoof sender addresses when deploying L2 smart contracts, potentially stealing funds from account abstraction wallets.

Kakarot

High
Business logic

handle_l1_message may unfairly revert l2 tx with sufficient l1 sender balance, due to vulnerable fee charge implementation

The handle_l1_message function hardcodes a very high gas limit and gas price, so it deducts a large max_fee from the L1 sender's cached balance before checking if the actual transfer can succeed. This can cause a valid L2 transaction to revert with an exceptional halt and charge the full max_fee, even when the sender had enough balance for the transfer and actual fee.

Kakarot

Medium