zkSync Era - leviticus1129's results

Future-proof zkEVM on the mission to scale freedom for all.

General Information

Platform: Code4rena

Start Date: 02/10/2023

Pot Size: $1,100,000 USDC

Total HM: 28

Participants: 64

Period: 21 days

Judge: GalloDaSballo

Total Solo HM: 13

Id: 292

League: ETH

zkSync

Findings Distribution

Researcher Performance

Rank: 41/64

Findings: 1

Award: $656.33

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
2 (Med Risk)
low quality report
satisfactory
duplicate-888

Awards

656.3255 USDC - $656.33

External Links

Lines of code

https://github.com/code-423n4/2023-10-zksync/blob/main/code/system-contracts/contracts/Constants.sol#L35

Vulnerability details

Impact

CURRENT_MAX_PRECOMPILE_ADDRESS is meant to return the current maximum deployed precompile address. The NatSpec states that there is currently only two precompiles deployed ecrecover and sha256. Looking at CURRENT_MAX_PRECOMPILE_ADDRESS it's returning the address of SHA256_SYSTEM_CONTRACT converted to uint256 which is 2.

Proof of Concept

Taking a look at keccak256 it's clear that this is a precompile. Doing some additional exploring into the era-test-node address_map.json we can see that keccak256 is again stated as a precompile and give us its address. Following that address via zksync block explorer we can see that keccak256 is deployed to mainnet. Meaning that CURRENT_MAX_PRECOMPILE_ADDRESS is not correctly updated for to account for Keccak256 precompile.

Tools Used

Manual review

Consider updated CURRENT_MAX_PRECOMPILE_ADDRESS to a value that properly reflect the correct current maximum deployed precompile address.

Assessed type

Other

#0 - c4-pre-sort

2023-10-31T07:11:05Z

bytes032 marked the issue as low quality report

#1 - miladpiri

2023-11-08T15:05:36Z

Duplicate.

#2 - c4-judge

2023-11-26T18:18:49Z

GalloDaSballo marked the issue as duplicate of #888

#3 - c4-judge

2023-11-28T15:58:45Z

GalloDaSballo marked the issue as satisfactory

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