https://github.com/coinfabrik/scout

Scout is an extensible open-source tool intended to assist ink! smart contract developers and auditors detect common security issues and deviations from best practices.

https://github.com/coinfabrik/scout

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary

Keywords

audit ink rust smart-contracts tool

Keywords from Contributors

auditing soroban static-analysis substrate vulnerability-detection smart-contract-security vulnerability-scanners scout stellar
Last synced: 5 months ago · JSON representation

Repository

Scout is an extensible open-source tool intended to assist ink! smart contract developers and auditors detect common security issues and deviations from best practices.

Basic Info
Statistics
  • Stars: 58
  • Watchers: 3
  • Forks: 9
  • Open Issues: 5
  • Releases: 5
Topics
audit ink rust smart-contracts tool
Created almost 3 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.md

Scout: Security Analysis Tool

https://img.shields.io/badge/license-MIT-green

Scout in a Dark Forest

Scout is an extensible open-source tool intended to assist ink! smart contract developers and auditors detect common security issues and deviations from best practices.

This tool will help developers write secure and more robust smart contracts.

Our interest in this project comes from our experience in manual auditing and our usage of comparable tools in other blockchains. To improve coverage and precision, we´ll persist in research efforts on static and dynamic analysis techniques. Find more about our ongoing research at our associated repository.

Quick Start

Install Scout Audit:

Make sure that Cargo is installed on your computer. Then, install Scout with the following command:

bash cargo install cargo-scout-audit

Run Scout Audit:

To run Scout on your project execute the following command:

bash cargo scout-audit

:bulb: Scout supports Cargo Workspaces. When run on a workspace, Scout will be executed on all packages specified as members of the workspace.

:warning: Make sure that your smart contracts compile properly. Scout won't run if any compilation errors exist.

For more information on installation and usage, please refer to the Getting Started section in our documentation below.

Documentation

Visit Scout's website to view the full documentation.

Detectors

| Detector ID | What it Detects | Test Cases | Severity | | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | | integer-overflow-or-underflow | An arithmetic operation overflows or underflows the available memory allocated to the variable. | 1, 2 | Critical | | set-contract-storage | Insufficient access control on setcontractstorage() function. | 1 | Critical | | reentrancy | Consistency of contract state under recursive calls. | 1, 2, 3 | Critical | | panic-error | Code panics on error instead of using descriptive enum. | 1 | Enhancement | | unused-return-enum | Return enum from a function is not completely used. | 1 | Minor | | dos-unbounded-operation | DoS due to unbounded operation. | 1 | Medium | | dos-unexpected-revert-with-vector | DoS due to improper storage. | 1 | Medium | | unsafe-expect | Improper usage of the expect method, leading to unexpected program crashes. | 1 | Medium | | unsafe-unwrap | Inappropriate usage of the unwrap method, causing unexpected program crashes. | 1 | Medium | | divide-before-multiply | Performing a division operation before a multiplication, leading to loss of precision. | 1 | Medium | | delegate-call | Invoking code in another contract keeping the first contract's context. | 1 | Critical | | zero-or-test-address | Avoid zero or test address assignment to prevent contract control loss. | 1 | Medium | | insufficiently-random-values | Avoid using block attributes for random number generation to prevent manipulation. | 1 | Critical | | unrestricted-transfer-from | Avoid passing an user-defined parameter as a from field in transfer-from | 1 | Critical | | assert-violation | Avoid the usage of the macro assert!, it can panic. | 1 | Enhancement | | avoid-core-mem-forget | The use of core::mem::forget could lead to memory leaks and logic errors | 1 | Enhancement | | avoid-format-string | The format! macro is not recommended. A custom error is recommended instead. | 1 | Enhancement | | unprotected-self-destruct | If users are allowed to call terminate_contract, they can intentionally or accidentally destroy the contract. | 1 | Critical | | iterators-over-indexing | Iterating with hardcoded indexes is slower than using an iterator. Also, if the index is out of bounds, it will panic. | 1 | Enhancement | | ink-version | Using an old version of ink! can be dangerous, as it may have bugs or security issues. Use the latest version available. | 1 | Enhancement | | unprotected-set-code-hash | If users are allowed to call terminate_contract, they can intentionally modify the contract behaviour. | 1 | Critical | | unprotected-mapping-operation | Modifying mappings with an arbitrary key given by the user could lead to unintented modifications of critical data, modifying data belonging to other users, causing denial of service, unathorized access, and other potential issues. | 1 | Critical | | lazy-delegate | Delegated calls in ink! need lazy storage. | 1 | Critical |

Tests

To validate our tool, we provide a set of code examples located in the test-cases folder.

In order to run the integration tests, navigate to apps/cargo-scout-audit and run:

console cargo test --all --all-features

In order to run the tests for a particular test-case, run the same command on that particular test-case folder (e.g: test-cases/delegate-call/delegate-call-1/vulnerable-example)

Acknowledgements

Scout is an open source vulnerability analyzer developed by CoinFabrik's Research and Development team.

We received support through grants from both the Web3 Foundation Grants Program and the Aleph Zero Ecosystem Funding Program.

| Grant Program | Description | |---------------|-------------| | Web3 Foundation | Proof of Concept: We collaborated with the Laboratory on Foundations and Tools for Software Engineering (LaFHIS) at the University of Buenos Aires to establish analysis techniques and tools for our detectors, as well as to create an initial list of vulnerability classes and code examples. View Grant | Application Form.

Prototype: We built a functioning prototype using linting detectors built with Dylint and expanded the list of vulnerability classes, detectors, and test cases. View Prototype | Application Form. | | Aleph Zero | We improved the precision and number of detectors for the tool with a multi-phase approach. This included a manual vulnerability analysis of projects within the Aleph Zero ecosystem, comprehensive testing of the tool on leading projects, and refining its detection accuracy. |

About CoinFabrik

We - CoinFabrik - are a research and development company specialized in Web3, with a strong background in cybersecurity. Founded in 2014, we have worked on over 180 blockchain-related projects, EVM based and also for Solana, Algorand, and Polkadot. Beyond development, we offer security audits through a dedicated in-house team of senior cybersecurity professionals, currently working on code in Substrate, Solidity, Clarity, Rust, and TEAL.

Our team has an academic background in computer science and mathematics, with work experience focused on cybersecurity and software development, including academic publications, patents turned into products, and conference presentations. Furthermore, we have an ongoing collaboration on knowledge transfer and open-source projects with the University of Buenos Aires.

License

Scout is licensed and distributed under a MIT license. Contact us if you're looking for an exception to the terms.

Owner

  • Name: CoinFabrik
  • Login: CoinFabrik
  • Kind: organization
  • Location: Argentina

GitHub Events

Total
  • Issues event: 9
  • Watch event: 6
  • Delete event: 13
  • Issue comment event: 10
  • Push event: 24
  • Pull request event: 23
  • Fork event: 4
  • Create event: 17
Last Year
  • Issues event: 9
  • Watch event: 6
  • Delete event: 13
  • Issue comment event: 10
  • Push event: 24
  • Pull request event: 23
  • Fork event: 4
  • Create event: 17

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 825
  • Total Committers: 12
  • Avg Commits per committer: 68.75
  • Development Distribution Score (DDS): 0.64
Past Year
  • Commits: 8
  • Committers: 3
  • Avg Commits per committer: 2.667
  • Development Distribution Score (DDS): 0.25
Top Committers
Name Email Commits
Facundo Lerena f****a@g****m 297
aon 2****n 199
Jose Garcia Crosta j****a@g****m 94
Camila Gallo c****0@g****m 82
Arturo Beccar-Varela 1****r 56
Agustín Losiggio a****o@g****m 40
Jose Garcia j****a@M****l 26
aweil d****l@c****m 20
MartinOntiveros 9****s 6
unknown a****o@c****m 3
Pinola007 1****7 1
Matias Cabello m****o@c****m 1
Committer Domains (Top 20 + Academic)