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

Fix security bug #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix security bug #1

wants to merge 1 commit into from

Conversation

liarco
Copy link

@liarco liarco commented Jul 13, 2023

Hi @miguelmota, thank you very much for this example. I was doing some research about the zkEVM bridging protocol and this saved me a lot of time.
Anyway, I might be wrong, but I think I spot a security bug in the example and I wanna make sure other people using this as a reference won't make wrong assumptions.

The L2Contract.sol implementation sets an l2Bridge variable in the constructor, but it's never used. While checking out the onMessageReceived(...) function I noticed there's no check to make sure the call is actually from the L2 Bridge.
Relying on the originAddress alone is no enough here as any value can be passed by a malicious caller.

I hope this can help.

@re1ro
Copy link

re1ro commented Jan 25, 2024

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants