CLI security scanner for checking Bittensor subnet repositories before miners run them.
Project description
SNCheck CLI
SNCheck helps miners inspect Bittensor subnet repositories before cloning, installing, or running them.
SNCheck does not certify that a repository is safe. It reports suspicious patterns and Bittensor-specific risk signals so users can review them before running code.
Install
pipx install sncheck
Or from source:
git clone https://github.com/sncheck/sncheck-cli
cd sncheck-cli
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Usage
sncheck check https://github.com/example/subnet
sncheck check ./local-subnet-repo
sncheck check https://github.com/example/subnet --format json
sncheck check ./local-subnet-repo --fail-on high
Other commands:
sncheck rules list
sncheck rules explain SH-CURL-BASH-001
sncheck version
Reducing noise
Some patterns (like hotkey) appear throughout normal subnet code. SNCheck keeps
these quiet: hotkey/coldkey references produce at most one finding per file,
and hotkey is reported as info (context, not risk). By default the report
shows findings at low and above; the summary at the bottom always reflects the
full counts.
sncheck check <target> # default: low and above
sncheck check <target> --min-severity medium # only medium+ (cut more noise)
sncheck check <target> --min-severity info # show everything, including hotkey context
sncheck check <target> --rules shell,python # only run specific groups
What It Detects
High-signal wallet risks (the operations that actually steal keys):
- Wallet exfiltration — reading a coldkey/mnemonic and sending it over the network (critical)
- Wallet directory copy —
cp/tar/scpof~/.bittensoroff the machine (high) - Reading wallet key files — opening coldkey/wallet files (high)
- Fund-moving commands —
btcli transfer/btcli stake(critical/medium)
Other risks:
- Remote scripts piped to shell (
curl ... | bash), base64-decoded payloads - Python dynamic execution (
eval,exec,os.system,subprocess(shell=True),pickle.load) - Docker install risks (root user, privileged, host mounts)
- Dependency hygiene issues (missing lockfiles, unpinned/remote dependencies)
Referencing the wallet directory, a hotkey, or a coldkey is expected in nearly every subnet repo, so SNCheck treats a plain reference as low/info context — not a risk. The high/critical severities are reserved for code that does something dangerous with wallet material.
Example Output
Overall risk: High
[HIGH] SH-CURL-BASH-001 Remote script piped to shell
File: setup.sh:12
Evidence: curl https://example.com/install.sh | bash
Limitations
- SNCheck performs static analysis only. It never executes scanned repository code.
- A clean report does not guarantee a repository is safe. Rules detect known risky patterns, not every possible threat.
- Some findings are context-dependent and require manual review. SNCheck uses neutral, evidence-first wording and points you to the file and line so you can decide.
Security
Do not report live exploit details for active subnet repositories in public issues before maintainers have had a chance to respond. See SECURITY.md.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sncheck-0.1.0.tar.gz.
File metadata
- Download URL: sncheck-0.1.0.tar.gz
- Upload date:
- Size: 38.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce701da1a05313ec5b70e89f86696d6e2c06f2dc02615f1e4af91143690e9029
|
|
| MD5 |
382b1fa279cf7d7437cb0b8160848af3
|
|
| BLAKE2b-256 |
fa838bba5e8816d26fd853e3a8a72511cbe27ca4c4f16749a90c82a3bcc69b42
|
File details
Details for the file sncheck-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sncheck-0.1.0-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af28cef3ebb8fb2dc1105643d0c31e468ce7b43cbc4e9546d5a32df00ed92c27
|
|
| MD5 |
b081f744e9ac1ac1e0f783d41efafbde
|
|
| BLAKE2b-256 |
73e1cb614aaf7dbe049d5a4583294b81da0c8a9617abec6eb2ca64e18c74a79b
|