Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit b20d62b

Browse files
🎉 Security considerations new format (#248)
* Security considerations updated * Update format check --------- Co-authored-by: Omar U. Espejel <espejelomar@gmail.com>
1 parent 38b906f commit b20d62b

16 files changed

+517
-0
lines changed

src/SUMMARY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
- [Starknet-py: Python SDK 🚧](ch02-11-starknet-py.md)
3030
- [Starknet-rs: Rust SDK 🚧](ch02-12-starknet-rs.md)
3131
- [Foundry Forge: Testing](ch02-13-foundry-forge.md)
32+
- [Security Tools](ch02-13-security-tools.md)
33+
- [Cairo-fuzzer](ch02-13-01-cairo-fuzzer.md)
34+
- [Caracal](ch02-13-02-caracal.md)
35+
- [Thoth](ch02-13-03-thoth.md)
36+
- [Security Considerations](ch02-13-04-security-considerations.md)
3237

3338
## Architecture
3439

src/ch02-13-01-cairo-fuzzer.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Cairo-fuzzer
2+
3+
[Cairo-fuzzer](https://github.com/FuzzingLabs/cairo-fuzzer) is a tool designed for smart contract developers to test the security. It can be used as an independent tool or as a library.
4+
5+
## Features:
6+
7+
<img alt="cairo-fuzzer" src="img/ch02-13-cairo-fuzzer.png" class="center" style="width: 75%;" />
8+
9+
- Run Cairo contract
10+
- Run Starknet contract
11+
- Replayer of fuzzing corpus
12+
- Minimizer of fuzzing corpus
13+
- Load old corpus
14+
- Handle multiple arguments
15+
- Workspace architecture
16+
- Import dictionnary
17+
- Use Cairo-fuzzer as a library
18+
19+
## Usage:
20+
21+
```bash
22+
cargo run --release -- --cores 3 --contract tests/fuzzinglabs.json --function "Fuzz_symbolic_execution"
23+
24+
For more usage information, follow our tutorial
25+
CMDLINE (--help):
26+
27+
Usage: cairo-fuzzer [OPTIONS]
28+
29+
Options:
30+
--cores <CORES> Set the number of threads to run [default: 1]
31+
--contract <CONTRACT> Set the path of the JSON artifact to load [default: ]
32+
--function <FUNCTION> Set the function to fuzz [default: ]
33+
--workspace <WORKSPACE> Workspace of the fuzzer [default: fuzzer_workspace]
34+
--inputfolder <INPUTFOLDER> Path to the inputs folder to load [default: ]
35+
--crashfolder <CRASHFOLDER> Path to the crashes folder to load [default: ]
36+
--inputfile <INPUTFILE> Path to the inputs file to load [default: ]
37+
--crashfile <CRASHFILE> Path to the crashes file to load [default: ]
38+
--logs Enable fuzzer logs in file
39+
--seed <SEED> Set a custom seed (only applicable for 1 core run)
40+
--run-time <RUN_TIME> Number of seconds this fuzzing session will last
41+
--config <CONFIG> Load config file
42+
--replay Replay the corpus folder
43+
--minimizer Minimize Corpora
44+
-h, --help Print help information
45+
```

src/ch02-13-02-caracal.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Caracal
2+
3+
[Caracal](https://github.com/crytic/caracal) is a static analyzer tool over the SIERRA representation for Starknet smart contracts.
4+
5+
## Features
6+
7+
- Detectors to detect vulnerable Cairo code
8+
- Printers to report information
9+
- Taint analysis
10+
- Data flow analysis framework
11+
- Easy to run in Scarb projects
12+
13+
## Installation
14+
15+
Precompiled binaries
16+
17+
Precompiled binaries are available on our releases page. If you are using Cairo compiler 1.x.x uses the binary v0.1.x otherwise if you are using the Cairo compiler 2.x.x uses v0.2.x.
18+
19+
### Building from source
20+
21+
You need the Rust compiler and Cargo. Building from git:
22+
23+
```bash
24+
cargo install --git https://github.com/crytic/caracal --profile release --force
25+
```
26+
27+
### Building from a local copy:
28+
29+
```bash
30+
git clone https://github.com/crytic/caracal
31+
cd caracal
32+
cargo install --path . --profile release --force
33+
```

src/ch02-13-03-thoth.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Thoth
2+
3+
[Thoth](https://github.com/FuzzingLabs/thoth) (pronounced "taut" or "toss") is a Cairo/Starknet security toolkit including analyzers, disassemblers & decompilers written in Python 3. Thoth's features include the generation of the call graph, the control-flow graph (CFG) and the data-flow graph for a given Sierra file or Cairo/Starknet compilation artifact. It also includes some really advanced tools like a Symbolic execution engine and Symbolic bounded model checker.
4+
5+
## Features
6+
7+
- Remote & Local: Thoth can both analyze contracts deployed on Mainnet/Goerli and compiled locally on your machine.
8+
- Decompiler: Thoth can convert assembly into decompiled code with SSA (Static Single Assignment)
9+
- Call Flow analysis: Thoth can generate a Call Flow Graph
10+
- Static analysis: Thoth can run various analyzers of different types (security/optimization/analytics) on the contract
11+
- Symbolic execution: Thoth can use the symbolic execution to find the right variables values to get through a specific path in a function and also automatically generate test cases for a function.
12+
- Data Flow analysis: Thoth can generate a Data Flow Graph (DFG) for each function
13+
- Disassembler: Thoth can translate bytecode into assembly representation
14+
- Control Flow analysis: Thoth can generate a Control Flow Graph (CFG)
15+
- Cairo Fuzzer inputs generation: Thoth can generate inputs for the Cairo fuzzer
16+
- Sierra files analysis : Thoth can analyze Sierra files
17+
- Sierra files symbolic execution : Thoth allows symbolic execution on sierra files
18+
- Symbolic bounded model checker : Thoth can be used as a Symbolic bounded model checker
19+
<img alt="thoth" src="img/ch02-13-thoth.png" class="center" style="width: 75%;" />
20+
21+
## Installation
22+
23+
```bash
24+
sudo apt install graphviz
25+
git clone https://github.com/FuzzingLabs/thoth && cd thoth
26+
pip install .
27+
thoth -h
28+
```

0 commit comments

Comments
 (0)