Skip to content

add smart contract fuzzer #1313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

add smart contract fuzzer #1313

wants to merge 5 commits into from

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Apr 21, 2025

Neo Smart Contract Fuzzer Implementation

This PR implements a comprehensive fuzzing system for Neo N3 smart contracts. The fuzzer is designed to test Neo N3 smart contracts for various vulnerabilities and ensure they compile and run correctly.

Features

  • Symbolic Execution Engine: Implements a symbolic execution engine that can analyze Neo smart contracts without actually running them
  • Vulnerability Detection: Includes detectors for common smart contract vulnerabilities:
    • Reentrancy vulnerabilities
    • Integer overflow/underflow
    • Unauthorized access
    • Storage manipulation issues
    • Unsafe native contract calls
  • Path Exploration: Explores multiple execution paths through a contract to find potential vulnerabilities
  • Constraint Solving: Uses constraint solving to determine if vulnerability conditions can be satisfied

Implementation Details

  • Uses the Neo.Compiler.CSharp CompilationEngine directly to compile contracts
  • Generates proper NEF and manifest files for contract analysis
  • Implements a symbolic virtual machine that can execute Neo VM instructions symbolically
  • Provides detailed vulnerability reports with specific information about detected issues

Testing

  • Comprehensive unit tests in Neo.SmartContract.Fuzzer.Tests verify the functionality of all components
  • All 50 unit tests pass successfully

Future Work

  • Expand vulnerability detection to cover more security issues
  • Improve performance for analyzing complex contracts
  • Add support for more advanced symbolic execution techniques
  • Enhance reporting with more detailed vulnerability information and remediation suggestions

Documentation

Documentation for the Neo Smart Contract Fuzzer can be found in the docs/fuzzer/smartcontract directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant