Test compromises host environment resulting loss of funds
Normally, smart contract tests are expected to execute within a deterministic and sandboxed virtual machine environment, ensuring no unintented side effects or interactions with the host system.
In this case, a malicious test uses vm.ffi to invoke shell commands that simulate scanning the local environment, harvesting sensitive information like a private key, and broadcasting a transaction to steal funds. Even though this appreas partially simulated via terminal output, the structure enables real-world abuse if further are introduced.
This demonstates an abuse of the test framework's ffi capability to potentially execute hostile actions against the developer's environment.
Likelihood: High
Any developer running the test suite locally with Foundry's ffi feature enabled will execute arbitrary shell code. Users may assume safety when running the suite as it is embedded in the project.
Impact: High
Host enviroment is compromised with potential loss of funds.
Remove the following line from foundry.toml
Use isolated environment such as vscode devcontainers to run the tests, ensure no private data are exposed to the environment.
OOS / Info
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.