-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
L2Sender reinit fix #8797
L2Sender reinit fix #8797
Conversation
Semgrep found 1
Service 'backend-goerli' is running with a writable root filesystem. This may allow malicious applications to download and run additional payloads, or modify container files. If an application inside a container has to save something temporarily consider using a tmpfs. Add 'read_only: true' to this service to prevent this. Ignore this finding from writable-filesystem-service.Semgrep found 1
Service 'backend-goerli' allows for privilege escalation via setuid or setgid binaries. Add 'no-new-privileges:true' in 'security_opt' to prevent this. Ignore this finding from no-new-privileges. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #8797 +/- ##
===========================================
- Coverage 34.52% 25.67% -8.86%
===========================================
Files 167 119 -48
Lines 7171 4892 -2279
Branches 1214 1066 -148
===========================================
- Hits 2476 1256 -1220
+ Misses 4545 3530 -1015
+ Partials 150 106 -44
Flags with carried forward coverage won't be shown. Click here to find out more.
|
dc753a1
to
18097d2
Compare
Do we also need the same fix in the optimism portal? |
It's not critical, because we write the withdraw to the mapping before sending, but we should make the fix anyways. optimism/packages/contracts-bedrock/src/L1/OptimismPortal.sol Lines 319 to 320 in 18097d2
I will add that to this PR. |
18097d2
to
4580aa7
Compare
Semgrep found 7
Prefer Semgrep found 1
Detected 'printf' or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package to render data to users. Ignore this finding from no-printf-in-responsewriter.Semgrep found 1
Detected directly writing or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package and render data using 'template.Execute()'. Ignore this finding from no-direct-write-to-responsewriter.Semgrep found 1
Found an HTTP server without TLS. Use 'http.ListenAndServeTLS' instead. See https://golang.org/pkg/net/http/#ListenAndServeTLS for more information. Ignore this finding from use-tls.Semgrep found 1
Consider to use well-defined context Ignore this finding from context-todo.Semgrep found 1
use fmt.Fprintf(w, |
3f8faa9
to
3f9d045
Compare
Warning Rate Limit Exceeded@maurelian has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 56 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates to the contracts involve incrementing semantic version constants, enhancing initialization checks, and adding reentrancy protection. The Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit's AI:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
packages/contracts-bedrock/test/L1/L1CrossDomainMessenger.t.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/test/L1/L1CrossDomainMessenger.t.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/test/L1/L1CrossDomainMessenger.t.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/test/L1/L1CrossDomainMessenger.t.sol
Outdated
Show resolved
Hide resolved
3f9d045
to
f80e4b9
Compare
Semgrep found 1
Prefer |
Description
Fixes an issue which would allow for a single messages to be replayed twice by intercepting an upgrade.
This is addressed in two ways:
xDomainMsgSender
if it is not the default value.successfulMessages
for the message is still false after theexternal call.
Exploit Description
To perform the exploit, the following steps must be taken by the attacker:
withdrawal transaction.
upgrade transaction and then re-enter
relayMessage()
with their own samewithdrawal message.
xDomainMsgSender
has been reset by the upgrade.The attacker must also satisfy the following with their withdrawal message:
relayMessage()
. A fresh withdrawalcannot reenter as it checks
failedMessages[versionedHash]
is true.drain from the contract.