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

security: automatic remappings can be dangerous #9146

Open
2 tasks done
QGarchery opened this issue Oct 19, 2024 · 0 comments
Open
2 tasks done

security: automatic remappings can be dangerous #9146

QGarchery opened this issue Oct 19, 2024 · 0 comments
Labels
P-normal Priority: normal T-bug Type: bug T-to-investigate Type: to investigate

Comments

@QGarchery
Copy link

QGarchery commented Oct 19, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (a8c3e9c 2024-10-19T00:21:12.472031180Z)

What command(s) is the bug in?

forge build

Operating System

Linux

Describe the bug

Forge infers remappings by taking into account remappings of sub-projects. When there are conflicting remappings, it seems like the longest / most specified has the priority. This can be dangerous, as adding sub-projects can now completely change the code that is executed, even if the remappings of the root project are not changed.

Reproduced in this test. Notice that removing the lib/interesting-project makes the test pass again. Also notice how interesting-project can be very deep in the sub-projects, so it can be difficult to detect that the executed bytecode has changed.

Proposed solution: make remappings of the root project have priority over remappings of sub-projects.

@QGarchery QGarchery added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Oct 19, 2024
@zerosnacks zerosnacks changed the title Automatic remappings can be dangerous security: automatic remappings can be dangerous Oct 21, 2024
@zerosnacks zerosnacks added P-normal Priority: normal T-to-investigate Type: to investigate and removed T-needs-triage Type: this issue needs to be labelled labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-normal Priority: normal T-bug Type: bug T-to-investigate Type: to investigate
Projects
Status: Todo
Development

No branches or pull requests

2 participants