File: test/MerkleAirdropTest.t.sol (lines 38–42), foundry.toml (line 8)
The test file contains testPwned(), which uses Foundry's Foreign Function Interface (FFI) to execute an arbitrary shell command (touch youve-been-pwned) on the host machine. Combined with ffi = true in foundry.toml, running the test suite with forge test will execute shell commands with the developer's local OS permissions. An attacker who can modify the test file (e.g., via a supply chain attack on the repo, a malicious PR, or a compromised dependency) can execute arbitrary code on any machine that runs forge test.
foundry.toml — FFI globally enabled:
CheatCodes.t.sol:
MerkleAirdropTest.t.sol:
While touch is benign, the exact same pattern can execute:
This is a supply chain / developer machine attack vector with potentially catastrophic consequences — including private key exfiltration (the .env file in the Makefile likely contains ZKSYNC_MAINNET_RPC_URL and ETHERSCAN_API_KEY, and possibly a deployer private key).
The Makefile confirms .env is used:
Any developer running forge test (or CI/CD pipeline) executes the FFI command.
Escalates to full host compromise if the shell command is malicious.
Private key theft possible via .env exfiltration.
CI/CD pipeline poisoning — if tests run in CI with cloud credentials, those credentials can be stolen.
Severity: High (developer machine / CI compromise risk)
Manual analysis
foundry.toml configuration review
Remove testPwned() entirely — it serves no legitimate test purpose.
Disable FFI globally unless strictly needed:
If FFI is needed for specific tests, use a separate profile:
And run only: forge test --profile ffi --match-test testSpecificFFITest
Add a .gitignore rule and warn developers about .env file security.
Use vm.envString() Foundry cheatcode pattern for secrets instead of shell-level access.
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.