Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 516 Bytes

31.md

File metadata and controls

12 lines (8 loc) · 516 Bytes

Hiding Malicious Code with External Contract

Description:

In Solidity any address can be casted into specific contract, even if the contract at the address is not the one being casted. This can be exploited to hide malicious code.

Remediation:

  1. Initialize a new contract inside the constructor
  2. Make the address of external contract public so that the code of the external contract can be reviewed

References:

https://solidity-by-example.org/hacks/hiding-malicious-code-with-external-contract/