▎ Note: This finding is out of scope for the audit. Submitting as an informational/educational note. I loved how testPwned() was implemented — it's a clever and clean demonstration of exactly how an FFI-based supply-chain attack would look in practice. Great way to teach awareness of this vector.
Root + Impact
Foundry's FFI (Foreign Function Interface) cheatcode allows Solidity tests to execute arbitrary shell commands on the host machine. This is an opt-in
feature enabled via ffi = true in foundry.toml, intended for advanced testing scenarios that require interaction with native tooling.
testPwned() abuses this mechanism by calling cheatCodes.ffi() with a shell command (touch youve-been-pwned). Because ffi = true is set globally in
foundry.toml, this command executes silently on the real filesystem of any machine that runs forge test — including auditors, contributors, and CI/CD
pipelines — with no warning or prompt.
Any person cloning this repository or other that have same ffi calldata and running forge test or forge coverage triggers the FFI command automatically — no special invocation is needed.
CI/CD pipelines running automated test suites execute this command with the permissions of the pipeline runner, potentially on shared infrastructure.
The current payload (touch youve-been-pwned) is harmless, but the same pattern can be replaced with any shell command — exfiltrating private keys,
downloading and executing remote scripts, or deleting files — with zero additional complexity.
Auditors or developers running the test suite on machines with sensitive data (wallet keystores, .env files, SSH keys) are at risk if a malicious
variant of this pattern is used.
Disable FFI globally and only enable it in a dedicated profile when strictly required:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.