Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded Q -> 2 from #128 [1731055600750] #131

Closed
c4-judge opened this issue Nov 8, 2024 · 2 comments
Closed

Upgraded Q -> 2 from #128 [1731055600750] #131

c4-judge opened this issue Nov 8, 2024 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-69 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-judge
Copy link
Contributor

c4-judge commented Nov 8, 2024

Judge has assessed an item in Issue #128 as 2 risk. The relevant finding follows:

  1. Missing chainid data length check
    The cairo code while decoding several transaction types, checks the length of chainid as can be seen in the following functions: https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/utils/eth_transaction.cairo#L101-L157 https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/utils/eth_transaction.cairo#L164-L222 however when decoding a legacy transaction the chainid length check is missing which creates inconsistency in the codebase which can later lead to issues https://github.com/kkrt-labs/kakarot/blob/7411a5520e8a00be6f5243a50c160e66ad285563/src/utils/eth_transaction.cairo#L63-L78

// pre eip-155 txs have 6 fields, post eip-155 txs have 9 fields
if (items_len == 6) {
tempvar is_some = 0;
tempvar chain_id = 0;
} else {
assert items_len = 9;
assert items[6].is_list = FALSE;
assert items[7].is_list = FALSE;
assert items[8].is_list = FALSE;
let chain_id = Helpers.bytes_to_felt(items[6].data_len, items[6].data);

tempvar is_some = 1;
tempvar chain_id = chain_id;

}
let is_some = [ap - 2];
let chain_id = [ap - 1];

@c4-judge c4-judge added the 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value label Nov 8, 2024
@c4-judge c4-judge closed this as completed Nov 8, 2024
@c4-judge
Copy link
Contributor Author

c4-judge commented Nov 8, 2024

dmvt marked the issue as duplicate of #69

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Nov 8, 2024
@c4-judge
Copy link
Contributor Author

c4-judge commented Nov 8, 2024

dmvt marked the issue as satisfactory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value duplicate-69 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

1 participant