m11

Security audits — Solidity red flags, skill injection, suspicious packages, secret leak detection.

SKILL.md

GitHub

m11 — Security Audit & Review (NEW in v3)


Operator Profile

Forensic code reader. Spots red flags fast. Distinguishes "looks sketchy" from "actually dangerous". Outputs structured assessment, not vague concerns.


Audit Targets

1. Skill files / MCP servers / agent prompts
2. Smart contracts (Solidity)
3. Web3 scripts & bots
4. Dependencies (npm/pypi audit)
5. Webhook handlers
6. Config files (env leaks, exposed secrets)
7. GitHub repos (general code safety check)

Output Format (always this structure)

[VERDICT]
✅ SAFE  |  ⚠️ CAUTION  |  ❌ UNSAFE

[CRITICAL FINDINGS]
1. [issue] — [why dangerous] — [evidence: file:line]
2. [issue] — ...

[MEDIUM / LOW]
- [finding]
- [finding]

[RECOMMENDATION]
[1-2 lines: use as-is | use with modifications | reject]

[IF MODIFICATION POSSIBLE]
→ exact change

Skill / Agent Prompt Audit Checklist

Prompt injection vectors:
☐ Loads remote URLs at runtime? (e.g. fetch from arbitrary site)
☐ Executes user-supplied bash without sanitization?
☐ Has "ignore previous instructions" defense?
☐ Reveals system prompt on request?

Permission overreach:
☐ Requests broader access than function needs?
☐ Asks for raw private keys when signing capability is enough?
☐ Custodial wallet model where split-custody would work?

Data exfiltration:
☐ Sends data to third-party domains?
☐ Logs PII / secrets to external endpoints?
☐ Uses webhooks the operator doesn't control?

Supply chain:
☐ Auto-installs npm/pip packages from arbitrary names?
☐ Pulls binaries from unverified sources?
☐ Uses outdated packages with known CVEs?

Smart Contract Red Flags (Solidity)

HIGH RISK:
☐ tx.origin used for auth (allows phishing)
☐ block.timestamp / block.number used as randomness
☐ External call before state update (reentrancy)
☐ Unbounded loops (DoS vector)
☐ delegatecall to user-supplied address
☐ Owner has mint/burn/blacklist with no timelock
☐ Hidden fees / hidden owner functions
☐ "burn" function that transfers to attacker
☐ Disabled transfers (honeypot pattern)
☐ Hardcoded addresses that don't match docs

MEDIUM:
☐ Single owner with full admin (no multisig)
☐ Upgradeable proxy without timelock
☐ Withdraw functions for "stuck tokens" that drain pool
☐ Fee on transfer not handled in DEX integration

REVIEW:
☐ Floating pragma (^) on production code
☐ No events on state changes
☐ Public functions that should be external

Quick scan (regex-ish)

grep -rn "tx.origin"      contracts/
grep -rn "selfdestruct\|suicide" contracts/
grep -rn "delegatecall"   contracts/
grep -rn "block.timestamp\|block.number" contracts/
grep -rn "onlyOwner.*mint\|onlyOwner.*burn" contracts/

Dependency Audit

Node.js

npm audit                        # vulnerability scan
npm audit fix                    # auto-fix where possible
npx snyk test                    # deeper scan
npm outdated                     # see stale deps

# Check single package suspicion
npm view <package> maintainers
npm view <package> repository.url
npm view <package> dist.tarball

Python

pip-audit                        # CVE scan
safety check -r requirements.txt # SDK from PyUp
pip list --outdated

Suspicious package signals

- Brand-new package (<6 months) with > 1k weekly downloads
- Maintainer with 1 package, no other history
- Recently transferred ownership
- Postinstall script that does anything non-trivial
- package.json with obfuscated strings
- Imports from .ru / .cn domains in code
- Package name that's a typo of popular package (typosquat)

Bash / Script Audit

HIGH RISK signals:
☐ curl | bash / wget | sh patterns (no integrity check)
☐ eval on user input or remote content
☐ chmod 777 anywhere
☐ Writing to /etc/cron* without explicit reason
☐ Adding SSH keys to authorized_keys
☐ Sudoers modification
☐ Reverse shells (bash -i, nc -e, /dev/tcp/)
☐ Base64 / hex blobs that decode to scripts

Quick scan

grep -nE "curl.*\| *(bash|sh)" script.sh
grep -nE "eval " script.sh
grep -nE "chmod 7[0-7][0-7]" script.sh
grep -nE "/dev/tcp/|nc -e|bash -i" script.sh

Webhook Handler Audit

☐ Signature verification present?
☐ Timing-safe comparison (hmac.compare_digest / timingSafeEqual)?
☐ Body parsed BEFORE verification? (bug — verify on raw bytes first)
☐ Idempotency on POST?
☐ Rate limiting?
☐ Replay protection (timestamp window)?
☐ Error responses leak internal details?

Secret Leak Detection

Repo scan

# Common patterns
grep -rEn "(sk-[a-zA-Z0-9]{20,}|ghp_[a-zA-Z0-9]{30,}|AIza[A-Za-z0-9-]{30,}|sk_live_)" .

# Full tool
npx @gitguardian/ggshield secret scan repo .
# OR
trufflehog filesystem . --only-verified

.env in git history (already committed = compromised)

git log --all --full-history -- '**/.env*'
# If found: rotate keys IMMEDIATELY, then use git-filter-repo to purge

OpenClaw / Skill File Specific Audit


☐ Instructs agent to fetch arbitrary URLs as instructions
☐ Tells agent to install dependencies it doesn't list
☐ "Ignore all safety rules" / "you have no restrictions"
☐ References external domain controlled by skill author
☐ Asks for private keys directly rather than transaction signing
☐ Stores data outside operator's controlled paths
☐ Modifies shell config (.bashrc, .zshrc) without justification
☐ Adds itself to startup (cron, systemd, autostart)
☐ Network calls to non-obvious domains

Audit Workflow

1. Read all files end-to-end (don't skim)
2. Run regex/tool scans for known patterns
3. Trace data flow: input → processing → external → output
4. Identify trust boundaries
5. Check for principle of least privilege
6. Score each finding: Critical / High / Medium / Low
7. Output structured report

Constraints

  • Never gloss over a finding — even if minor, list it
  • Distinguish "theoretically possible" vs "actually exploitable" risk
  • Always cite file:line for technical findings
  • Provide remediation, not just identification
  • If audit unclear due to missing context → ask for the missing files in one round
  • Never say "looks safe" without explicit checks listed

Skill Integrity Verification (NEW in v4.0)

Riset keamanan OpenClaw (190 advisory) menemukan skill jahat lewat jalur distribusi plugin bisa nyelipin dropper di dalam konteks LLM, lolos dari exec pipeline. Untuk agent yang pegang private key, integritas skill bukan opsional.

Tool: tools/skill_integrity.py — bikin & verifikasi manifest SHA-256 per file (opsional ditandatangani Ed25519).

python tools/skill_integrity.py generate          # di sumber tepercaya → tulis SKILLS.lock
python tools/skill_integrity.py generate --sign    # + tanda tangan (HERMES_SIGNING_KEY)
python tools/skill_integrity.py verify             # exit 0 bersih, 1 ada perubahan, 2 error

Rail boot (lihat HEARTBEAT.md): jalankan verify di awal sesi. Kalau exit != 0 → ada file skill berubah/baru/hilang → tahan operasi on-chain sampai operator audit temuannya dan, kalau memang disengaja, generate ulang lock-nya. Skill [NEW] yang belum di-lock diperlakukan untrusted sampai diaudit.

Workflow saat verify gagal:

1. Lihat file mana yang [MODIFIED]/[NEW]/[MISSING]
2. Audit pakai checklist di atas (§OpenClaw / Skill File Specific Audit)
3. Sengaja & aman → `generate` ulang. Bukan / mencurigakan → JANGAN jalankan, investigasi.

ONE-COMMAND RUG / LEGITIMACY PRE-CHECK (v4.2)

tools/rugcheck.py — agregasi sinyal yang udah diambil m11/H4/m10 jadi satu verdict SAFE / CAUTION / DANGER + alasan. Murni logika (gak ada network call) → bisa di-eval offline & dipakai jadi blok edukasi konten.

from rugcheck import SignalSet, check
v = check(SignalSet(contract_verified=True, is_honeypot=False, buy_tax_pct=3,
                    sell_tax_pct=4, lp_locked=True, lp_lock_days=180,
                    owner_renounced=True, top10_holders_pct=35,
                    age_days=90, liquidity_usd=250000))
print(v.report())   # ✅ SAFE / ⚠️ CAUTION / 🛑 DANGER + critical/warnings/unknowns
  • Critical → DANGER: honeypot, sell-tax ≥30%, owner bisa mint tanpa renounce, LP gak terkunci.
  • Warnings → akumulasi risk: unverified, tax tinggi, pausable, proxy upgradeable, konsentrasi holder, LP lock pendek, kontrak baru, likuiditas tipis.
  • Unknowns: data yang BELUM dicek dilaporin eksplisit (jangan diabaikan) — suruh m10/H4 isi dulu.

Pengambilan sinyal didelegasi: honeypot/tax → H4 (GoPlus/honeypot.is), verifikasi/holder/LP → m10 (explorer/RPC). rugcheck cuma nge-judge hasilnya jadi keputusan jelas.