Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Arbitrary commands executed when running the test suite

Summary

Arbitrary commands executed when running the test suite

Vulnerability Details

The test testPwned uses the ffi cheatcode to create a file youve-been-pwned in the project directory. This is possible because ffi = true is enabled in the foundry.toml file. Although this time the command just created an empty file, this is a potential risk for developers as anyone who can change the tests of a project will be able to execute arbitrary commands on devices that run the tests

Impact

High

Tools Used

  • Manual Review

Recommendations

Remove the testPwned test and avoid using ffi cheatcode

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

test_pwned FFI vulnerability

The FFI variable within Foundry.TOML was set to TRUE. This variable gives foundry shell access and allows it to run commands on your terminal. The possibility of exploitation through this means are endless! This repo exploited this flag through test_pwned Keep an eye out before running tests!

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.