# Aderyn — Le Nouvel Analyseur Statique Rust pour Solidity
Dans le paysage des outils de sécurité Solidity, Slither a longtemps régné en maître. Mais un nouveau challenger émerge : Aderyn, un analyseur statique écrit en Rust qui promet vitesse et précision. Tour d'horizon complet.
Qu'est-ce qu'Aderyn ?
Aderyn est un static analyzer open-source développé par Cyfrin (l'équipe derrière Updraft et CodeHawks). Écrit en Rust, il analyse le code Solidity pour détecter :
- Vulnérabilités de sécurité (reentrancy, access control, etc.)
- Bugs logiques (overflow, division par zéro, etc.)
- Code smells et anti-patterns
- Optimisations gas potentielles
Première release publique : juillet 2024
Repo GitHub : https://github.com/Cyfrin/aderyn
Langage : Rust (vs Python pour Slither)
Installation
Trois méthodes :
1. Via Cargo (recommandé)
cargo install aderyn
# Verify installation
aderyn --version
# aderyn 0.5.2
2. Via Binary
# macOS (Apple Silicon)
curl -L https://github.com/Cyfrin/aderyn/releases/latest/download/aderyn-macos-arm64 -o aderyn
chmod +x aderyn
sudo mv aderyn /usr/local/bin/
# Linux
curl -L https://github.com/Cyfrin/aderyn/releases/latest/download/aderyn-linux-amd64 -o aderyn
chmod +x aderyn
sudo mv aderyn /usr/local/bin/
3. Via Docker
docker pull ghcr.io/cyfrin/aderyn:latest
docker run --rm -v $(pwd):/project ghcr.io/cyfrin/aderyn /project
Utilisation Basique
Sur un projet Foundry standard :
# Analyze current directory
aderyn .
# Analyze specific path
aderyn ./src
# Output to file
aderyn . -o report.md
# JSON output for CI/CD
aderyn . --json > aderyn-report.json
Temps d'exécution : ~2-5 secondes pour un projet de 10 000 lignes (10x plus rapide que Slither).
Exemple de Rapport
Prenons un contrat vulnérable :
// VulnerableBank.sol
contract VulnerableBank {
mapping(address => uint256) public balances;
function deposit() public payable {
balances[msg.sender] += msg.value;
}
function withdraw(uint256 amount) public {
require(balances[msg.sender] >= amount);
(bool success,) = msg.sender.call{value: amount}("");
require(success);
balances[msg.sender] -= amount; // ❌ After external call!
}
function emergencyWithdraw() public {
require(msg.sender == tx.origin); // ❌ tx.origin check
payable(msg.sender).transfer(address(this).balance);
}
}
Rapport Aderyn :
# Aderyn Analysis Report
High Severity Issues
[H-1] Reentrancy Vulnerability
Location: VulnerableBank.sol:10-14
Description: State change after external call allows reentrancy
Recommendation: Update balance before external call (Checks-Effects-Interactions)
[H-2] Use of tx.origin for Authentication
Location: VulnerableBank.sol:17
Description: tx.origin can be manipulated by intermediary contracts
Recommendation: Use msg.sender instead
Summary
- High: 2
- Medium: 0
- Low: 0
- Gas: 0
Détecteurs Disponibles
Aderyn embarque 45+ détecteurs (v0.5.2) :
Sécurité Critique
- reentrancy : détecte les appels externes avant state changes
- unprotected-selfdestruct : selfdestruct sans access control
- delegatecall-to-untrusted : delegatecall avec target contrôlable
- uninitialized-state-variable : variables non initialisées
- tx-origin-auth : usage de tx.origin pour l'authentification
Sécurité Medium
- unprotected-setter : setters publics sans access control
- missing-zero-address-check : pas de validation address(0)
- unsafe-erc20-transfer : pas de check du retour de transfer()
- timestamp-dependence : logique basée sur block.timestamp
- block-number-dependence : randomness via block.number
Gas Optimization
- cache-array-length : longueur d'array lue en boucle
- state-variable-could-be-constant : variable immutable détectable
- public-variable-read-in-external : public au lieu d'external
Comparaison avec Slither
| Critère | Aderyn | Slither |
|---------|--------|---------|
| Langage | Rust | Python |
| Vitesse | ⚡ Ultra-rapide (2-5s) | Moyen (10-30s) |
| Détecteurs | 45+ | 90+ |
| Faux positifs | Bas | Moyen |
| Installation | Cargo/Binary | pip + solc-select |
| Maintenance | Active (Cyfrin) | Active (Trail of Bits) |
| AST utilisé | Solc AST natif | Slither IR custom |
| CI/CD ready | ✅ Binary standalone | ⚠️ Dépendances Python |
Verdict : Aderyn gagne en vitesse et simplicité, Slither en maturité et nombre de détecteurs.
Intégration CI/CD
GitHub Actions
# .github/workflows/security.yml
name: Security Analysis
on: [push, pull_request]
jobs:
aderyn:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Aderyn
run: |
curl -L https://github.com/Cyfrin/aderyn/releases/latest/download/aderyn-linux-amd64 -o aderyn
chmod +x aderyn
sudo mv aderyn /usr/local/bin/
- name: Run Aderyn
run: aderyn . --json > aderyn-report.json
- name: Check for High Severity Issues
run: |
HIGH_COUNT=$(jq '.issues | map(select(.severity == "High")) | length' aderyn-report.json)
if [ "$HIGH_COUNT" -gt 0 ]; then
echo "❌ Found $HIGH_COUNT high severity issues"
exit 1
fi
- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: aderyn-report
path: aderyn-report.json
Pre-commit Hook
# .git/hooks/pre-commit
#!/bin/bash
echo "Running Aderyn..."
aderyn . --json > /tmp/aderyn-report.json
HIGH_COUNT=$(jq '.issues | map(select(.severity == "High")) | length' /tmp/aderyn-report.json)
if [ "$HIGH_COUNT" -gt 0 ]; then
echo "❌ Commit blocked: $HIGH_COUNT high severity issues found"
jq '.issues[] | select(.severity == "High") | .description' /tmp/aderyn-report.json
exit 1
fi
echo "✅ No high severity issues found"
Configuration Avancée
Créez un fichier aderyn.toml :
# aderyn.toml
[analysis]
# Exclude specific detectors
exclude = ["cache-array-length", "public-variable-read-in-external"]
# Exclude paths
exclude_paths = ["test/", "script/", "lib/"]
# Only run specific detectors
# include = ["reentrancy", "tx-origin-auth"]
[output]
format = "markdown"
output_file = "security-report.md"
[severity]
# Treat medium issues as errors in CI
fail_on = ["High", "Medium"]
Puis :
aderyn . --config aderyn.toml
Cas Pratique : Analyser Uniswap V3
# Clone Uniswap V3
git clone https://github.com/Uniswap/v3-core
cd v3-core
# Install dependencies
npm install
# Run Aderyn
aderyn contracts/ -o uniswap-analysis.md
# Results (v0.5.2)
# - High: 0
# - Medium: 2 (timestamp-dependence in Oracle)
# - Low: 5 (gas optimizations)
# - Time: 3.2 seconds
Aderyn n'a trouvé aucun problème critique (normal, Uniswap est audité à mort), mais suggère des optimisations gas.
Limites Actuelles
Aderyn est jeune (2024) et a quelques limitations :
Ces gaps se réduisent rapidement (3-5 nouveaux détecteurs par release).
Quand Utiliser Aderyn vs Slither ?
Utilisez Aderyn si :
- ✅ Vous voulez de la vitesse (CI/CD, pre-commit hooks)
- ✅ Vous êtes sur un projet Foundry moderne
- ✅ Vous voulez un binary standalone sans dépendances
- ✅ Vous privilégiez peu de faux positifs
Utilisez Slither si :
- ✅ Vous avez besoin des 90+ détecteurs
- ✅ Vous voulez des printers (inheritance graph, call graph, etc.)
- ✅ Vous analysez du code legacy complexe
- ✅ Vous voulez personnaliser l'IR avec des détecteurs custom
Approche recommandée 2026 : utilisez les deux !
# Quick check with Aderyn
aderyn . --json > aderyn.json
# Deep analysis with Slither
slither . --json slither.json
# Compare results
diff <(jq '.issues[].title' aderyn.json) <(jq '.results[].description' slither.json)
Roadmap 2026
Cyfrin a annoncé pour Aderyn :
- Q2 2026 : Support des upgradeable proxies (UUPS, Transparent)
- Q3 2026 : Détection de front-running vulnerabilities
- Q4 2026 : Integration avec Foundry (plugin natif)
- 2027 : Support multi-chain (détecteurs spécifiques Arbitrum, Optimism, etc.)
Conclusion
Aderyn est une bouffée d'air frais dans l'écosystème des outils de sécurité Solidity. Sa rapidité et sa simplicité en font un excellent choix pour :
- L'intégration CI/CD
- Les pre-commit hooks
- Les audits rapides de code nouveau
Il ne remplace pas encore Slither pour des analyses approfondies, mais le gap se réduit chaque mois. En 2026, avoir Aderyn dans sa toolchain est un must.
Commencez dès aujourd'hui :
cargo install aderyn
aderyn --help
Et que la sécurité soit avec vous.