https://github.com/coinfabrik/scout-soroban

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

https://github.com/coinfabrik/scout-soroban

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 (10.3%) to scientific vocabulary

Keywords

smart-contract-security static-analysis vulnerability-detection vulnerability-scanners

Keywords from Contributors

audit ink smart-contracts soroban substrate scout stellar
Last synced: 5 months ago · JSON representation

Repository

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

Basic Info
  • Host: GitHub
  • Owner: CoinFabrik
  • License: mit
  • Language: Rust
  • Default Branch: default-do-not-use-scout-reserved
  • Homepage:
  • Size: 6.76 MB
Statistics
  • Stars: 41
  • Watchers: 1
  • Forks: 5
  • Open Issues: 17
  • Releases: 0
Topics
smart-contract-security static-analysis vulnerability-detection vulnerability-scanners
Created over 2 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.md

Scout Soroban: 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 Soroban Stellar smart contract developers and auditors detect common security issues and deviations from best practices.

This tool helps developers write secure and more robust smart contracts.

Our interest in this project comes from our experience in manual auditing and vulnerability detection in other blockchains (see Scout for ink!).

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 section below.

Detectors

Currently Scout includes the following detectors.

| Detector ID | What it Detects | Test Cases | Severity | | ------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | | divide-before-multiply | Performing a division operation before a multiplication, leading to loss of precision. | 1, 2, 3 | Medium | | unsafe-unwrap | Inappropriate usage of the unwrap method, causing unexpected program crashes. | 1| Medium | | unsafe-expect | Improper usage of the expect method, leading to unexpected program crashes. | 1| Medium | | overflow-check | An arithmetic operation overflows or underflows the available memory allocated to the variable. | 1| Critical | | insufficiently-random-values | Avoid using block attributes for random number generation to prevent manipulation. | 1| Critical | | unprotected-update-current-contract-wasm | If users are allowed to call update_current_contract_wasm(), they can intentionally modify the contract behaviour. | 1| Critical | | avoid-core-mem-forget | The use of core::mem::forget() could lead to memory leaks and logic errors. | 1 | Enhancement | | set-contract-storage | Insufficient access control on env.storage() method. | 1, 2, 3 | Critical | | avoid-panic-error | Code panics on error instead of using descriptive enum.| 1 | Enhancement | | avoid-unsafe-block | Using unsafe blocks in risks code safety and reliability.| 1 | Critical | | dos-unbounded-operation | DoS due to unbounded operation. | 1, 2, 3 | Medium | | soroban-version | Using an old version of Soroban can be dangerous, as it may have bugs or security issues. Use the latest version available. | 1 | Enhancement | | unused-return-enum | Return enum from a function is not completely used. | 1, 2 | Minor | | 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 | | assert-violation | Avoid the usage of the macro assert!, it can panic.| 1 | Enhancement | | unprotected-mapping-operation | Modifying mappings with an arbitrary key given by users can be a significant vulnerability. | 1, 2 | Critical | | dos-unexpected-revert-with-vector | DoS due to improper storage. | 1, 2 | Medium | | unrestricted-transfer-from | Avoid passing an user-defined parameter as a from field in transfer-from. | 1 | Critical | | unsafe-map-get | Inappropriate usage of the get method for Map in soroban | 1 | Medium | | zero-or-test-address | Avoid zero or test address assignment to prevent contract control loss. | 1 | Medium | | incorrect-exponentation | Warns against incorrect usage of ´^´. | 1 | Critical |

Output formats

You can choose the output format that best suit your needs. Scout offers html, markdown, json, pdf and sarif reports. To specify the desired output run the following command:

cargo scout-audit --output-format [html|md|pdf|json|sarif]

HTML report

Scout HTML report.

Scout VS Code extension

Add Scout to your development workspace with Scout's VS Code extension to run Scout automatically upon saving your file.

Scout VS Code extension.

:bulb: Tip: To see the errors highlighted in your code, we recommend installing the Error Lens Extension.

:point_right: Download Scout VS Code from Visual Studio Marketplace.

Scout GitHub Action

Integrate Scout into your CI/CD pipeline! Automatically run the tool against the targeted smart contracts. This immediate feedback loop allows developers to quickly address any issues before merging the code into the main branch, reducing the risk of introducing bugs or vulnerabilities.

Scout output as a comment in a pull request

Scout GitHub action output

:point_right: Find Scout GitHub Action in GitHub Marketplace.

Learning to Scout

Join us for an exciting series of video tutorials where you'll learn how to install and run Scout. Discover how to identify and resolve specific issues detected by the tool, and enhance your skills with our expert guidance.

:clapper: More videos comming soon!

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/divide-before-multiply/divide-before-multiply-1)

Documentation

Follow our documentation links below and learn more about the vulnerabilities detected by Scout, how the tool works and how to contribute to the project!

Acknowledgements

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

We received support through a grant from the Stellar Community Fund (SCF).

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, Stellar 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, TEAL and Stellar Soroban.

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: 10
  • Watch event: 7
  • Delete event: 1
  • Issue comment event: 8
  • Push event: 22
  • Pull request event: 12
  • Fork event: 4
  • Create event: 10
Last Year
  • Issues event: 10
  • Watch event: 7
  • Delete event: 1
  • Issue comment event: 8
  • Push event: 22
  • Pull request event: 12
  • Fork event: 4
  • Create event: 10

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 410
  • Total Committers: 14
  • Avg Commits per committer: 29.286
  • Development Distribution Score (DDS): 0.683
Past Year
  • Commits: 295
  • Committers: 11
  • Avg Commits per committer: 26.818
  • Development Distribution Score (DDS): 0.688
Top Committers
Name Email Commits
Jose Garcia Crosta j****a@g****m 130
Arturo Beccar-Varela 1****r 104
user i****n@c****m 56
Víctor M. González v****z@n****m 22
Sofi Azcoaga s****3@h****m 20
matiascabello m****o@g****m 19
Facundo Lerena f****a@g****m 18
tomasavola t****a@g****m 17
Agustín Losiggio a****o@g****m 10
Matias Cabello m****o@M****l 7
aweil d****l@c****m 4
valeriacaracciolo 7****o 1
MartinOntiveros 9****s 1
david weil d****l@e****r 1
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 2
  • Total downloads:
    • cargo 8,877 total
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 7
  • Total maintainers: 1
crates.io: scout-audit-internal

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

  • Versions: 5
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 6,348 Total
Rankings
Forks count: 19.9%
Stargazers count: 24.8%
Dependent repos count: 30.2%
Dependent packages count: 31.2%
Average: 40.7%
Downloads: 97.2%
Maintainers (1)
Last synced: 6 months ago
crates.io: scout-audit-internal-soroban

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

  • Versions: 2
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 2,529 Total
Rankings
Dependent repos count: 30.3%
Dependent packages count: 35.7%
Average: 54.3%
Downloads: 96.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

apps/cargo-scout-audit/Cargo.lock cargo
  • 319 dependencies
apps/cargo-scout-audit/Cargo.toml cargo
  • colored 2.0.0 development
  • config 0.13.3 development
  • serde 1.0.163 development
  • ansi_term 0.12.1
  • anyhow 1
  • cargo 0.72.2
  • cargo_metadata 0.17
  • clap 4.3.0
  • dunce 1.0.4
  • dylint 2.3.0
  • env_logger 0.10
  • home 0.5.5
  • itertools 0.11
  • log 0.4
  • regex 1.5
  • scout-audit-internal =0.2.1
  • serde_json 1.0
  • tempfile 3.8
detectors/Cargo.toml cargo
detectors/divide-before-multiply/Cargo.toml cargo
detectors/overflow-check/Cargo.toml cargo
  • toml 0.8.8
detectors/unsafe-expect/Cargo.toml cargo
scout-audit-clippy-utils/Cargo.lock cargo
  • arrayvec 0.7.4
  • either 1.9.0
  • if_chain 1.0.2
  • itertools 0.10.5
  • rustc-semver 1.1.0
scout-audit-clippy-utils/Cargo.toml cargo
scout-audit-internal/Cargo.toml cargo
test-cases/divide-before-multiply/divide-before-multiply-1/remediated-example/Cargo.toml cargo
test-cases/divide-before-multiply/divide-before-multiply-1/vulnerable-example/Cargo.toml cargo
test-cases/divide-before-multiply/divide-before-multiply-2/remediated-example/Cargo.toml cargo
test-cases/divide-before-multiply/divide-before-multiply-2/vulnerable-example/Cargo.toml cargo
test-cases/divide-before-multiply/divide-before-multiply-3/remediated-example/Cargo.toml cargo
test-cases/divide-before-multiply/divide-before-multiply-3/vulnerable-example/Cargo.toml cargo
test-cases/overflow-check/overflow-check-1/remediated-example/Cargo.toml cargo
test-cases/overflow-check/overflow-check-1/vulnerable-example/Cargo.toml cargo
test-cases/unsafe-expect/unsafe-expect-1/remediated-example/Cargo.toml cargo
test-cases/unsafe-expect/unsafe-expect-1/vulnerable-example/Cargo.toml cargo
test-cases/unsafe-unwrap/unsafe-unwrap-1/remediated-example/Cargo.toml cargo
test-cases/unsafe-unwrap/unsafe-unwrap-1/vulnerable-example/Cargo.toml cargo
apps/scout-extension/package.json npm
  • @types/command-exists ^1.2.0 development
  • @types/glob ^8.1.0 development
  • @types/mocha ^10.0.1 development
  • @types/node 16.x development
  • @types/vscode ^1.78.0 development
  • @typescript-eslint/eslint-plugin ^5.59.1 development
  • @typescript-eslint/parser ^5.59.1 development
  • @vscode/test-electron ^2.3.0 development
  • esbuild ^0.17.19 development
  • eslint ^8.39.0 development
  • glob ^8.1.0 development
  • mocha ^10.2.0 development
  • prettier ^2.8.8 development
  • typescript ^5.0.4 development
  • command-exists ^1.2.9
  • toml ^3.0.0
apps/scout-extension/pnpm-lock.yaml npm
  • 220 dependencies