Audit Process
Last updated
Was this helpful?
Last updated
Was this helpful?
When starting an audit, it is good to know when you are going to stop.
Set myself the goal of fully understanding the system to the point where I could reimplement it from scratch without being allowed a look at the original codebase. Not from remembering the code, but from having understood what the application is supposed to do. If you have examined a project that far and have not found a bug, the chances of finding one by continuing is low. However, if there is a bug in there, your chances of finding it with this method are high.
- Alexander Schlindwein
The audit process will be different based on if you are doing an audit on a bug bounty program, your own program, or have been hired either directly or working with an organization. However, the basic ideas of each of these steps should be considered for all audits.
Go through a checklist with the project team
Read specification/documentation of the project to understand the requirements, design and architecture
Run fast automated tools such as linters or static analyzers to investigate common Solidity pitfalls or missing smart contract best-practices
Manual code analysis to understand business logic and detect vulnerabilities in it
Look over the layout to see if it matches best practice and to understand how it is laid out if not
Create a data flow diagram (Consider using tools to help with this such as: , , )
Run slower but more deeper automated tools such as symbolic checkers, fuzzers or formal verification analyzers which typically require formulation of properties/constraints beforehand, hand holding during the analyses and some post-run evaluation of their results
Create proof-of-concept attacks to validate any findings
Communicate the status with the project team and get clarification on business logic or threat model
Steps 1-6 are more cyclical in nature than check off and move on
Write report summarizing the above with details on findings and recommendations
Deliver the report to the project team and discuss findings, severity and potential fixes
Evaluate fixes from the project team and verify that they indeed removed or mitigated the vulnerabilities identified in findings
Note: some skip step two and go directly into step 3. This is because documentation can lead you astray because it is wrong or misleading; however, the code is the source of truth.
pragma directives
import directives
Structs/Enums/Contracts
state variables
events
errors
modifiers
constructor
functions
When presented with several contracts and hundreds of lines of code, it may be daunting to find a starting place for the manual audit or even to start reviewing the code. Consider starting with either the or the areas of the smart contract.