Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Malicious code in the test suite that could compromize the developer computer

Summary

The test suite features a malicious function that can access the computer files

Vulnerability Details

This malicious function is accessing the file system of the computer running the tests.

function testPwned() public {
string[] memory cmds = new string[](2);
cmds[0] = "touch";
cmds[1] = string.concat("youve-been-pwned");
cheatCodes.ffi(cmds);
}

Impact

This function can compromise the computer and potentially look for private keys and other valuable informations.

Tools Used

Manual review

Recommendations

Remove this function before running tests

- import { _CheatCodes } from "./mocks/CheatCodes.t.sol";
- function testPwned() public {
- string[] memory cmds = new string[](2);
- cmds[0] = "touch";
- cmds[1] = string.concat("youve-been-pwned");
- cheatCodes.ffi(cmds);
- }
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Out of scope
Assigned finding tags:

ffi

Support

FAQs

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