revive^CC
is a static analysis tool for Hyperledger Fabric smart contracts (chaincode) aimed at detecting blockchain related security vulnerabilities to help developers to write clean and safe smart contracts. revive^CC
is one of the two existing static analysis tools for Hyperledger Fabric chaincode, with the other tool being Chainsecurity's Chaincode Scanner which can analyse chaincode files that meet certain requirements. What makes revive^CC
special is that the tool has brought the accessibility of security analysis to any chaincode file. This is something that has not been available until now.
The tool is an extension of the open source Go static analysis tool revive and was built using revive's framework. Therefore it contains all the benefits and checks of revive to help developers write clean Go code. revive^CC
was built as a part of my dissertation project on 'Analysing Smart Contracts' at the University of Sheffield.
1. Place folder in the your $GOPATH/src/github.com/youraccount
2. Go into directory sivachokkapu/revive-cc
3. $ make install
4. $ make build
5. Move the revive file into $GOPATH/bin
6. You should now be able to use revive commands
$ revive {chaincodefilename.go} - will analyse the file
$ revive -formatter stylish {chaincodefilename.go} - better output format
$ revive - on a directory will analyse all files if from the same package
Example of blacklisted chaincode import vulnerability in chaincode
Example of global state variable vulnerability in chaincode
Example of goroutines vulnerability in chaincode
Example of phantom read of ledger vulnerability in chaincode
Example of range over map vulnerability in chaincode
Example of read after write vulnerability in chaincode
MIT