Magidoc

Digital Signature (Import Tampering) Module

In Solidity, it is a common practice to import standard libraries as they contains reusable code for basic computation logic. Library functions which are inherited are not intended to be changed by developers. These libraries are altered by malicious actors, since little or no attention is given to inherited libraries by smart contract auditors while auditing as they assume standard libraries are not tampered by the developers.

This module compares the libraries used in the contracts with standard libraries to check if there is a deviation.

Example Scenario

#

Tampered Libary

#

    
  

Standard Library

#

    
  

The above is a real life example where (bsc-scan link) we could see that the second line in the sub function has been tampered: There is a hidden check which would return a large positive value when 11 is subtracted from the input value. This is hidden change in the library is known only to the developer who wrote the contract and he used it as a rug pull. Our module detects this change in the sub function and returns it as shown in the below API.

API Output

#

    
  

Conclusion

#

Thus the API identifies and flags contract and respective functions which does not follow the standard library implementation.