Skill · /nio-scan

/nio-scan — scan code for execution risks.

Point it at a file, directory, or third-party skill. Applies 15 static rules + a base64 decode pass across every supported file type and rolls findings up to one risk level.

Invoke: /nio-scan <path> (Claude Code) · $nio-scan or natural language (Codex) · or via the umbrella /nio scan <path> on any platform (incl. OpenClaw / Hermes). See Focused skills.

scan <path>

Scan a directory or a single file for execution risks. Applies 15 static rules + base64 decode pass across all supported file types.

Example

/nio scan ./src
/nio scan ~/third-party-skill
/nio scan package.json

What gets scanned

All of: .js .ts .jsx .tsx .mjs .cjs .py .json .yaml .yml .toml .sol .sh .bash .md

Skipped: node_modules/, dist/, build/, .git/, coverage/, __pycache__/, .venv/, venv/, and *.min.js, *.min.css, package-lock.json, yarn.lock, pnpm-lock.yaml.

Markdown handling

For .md files, only fenced code blocks are scanned (reduces false positives in prose). Base64-encoded payloads are decoded and re-scanned in every file type.

Detection rules

#RuleSeverityDescription
1SHELL_EXECHIGHCommand execution capabilities
2AUTO_UPDATECRITDownload-and-execute / auto-update
3REMOTE_LOADERCRITDynamic code loading from remote
4READ_ENV_SECRETSMEDEnvironment variable access
5READ_SSH_KEYSCRITSSH key file access
6READ_KEYCHAINCRITSystem keychain / browser profile
7PRIVATE_KEY_PATTERNCRITHardcoded private keys
8OBFUSCATIONHIGHCode obfuscation techniques
9PROMPT_INJECTIONCRITPrompt injection attempts
10NET_EXFIL_UNRESTRICTEDHIGHUnrestricted POST / upload
11WEBHOOK_EXFILCRITWebhook exfiltration domains
12TROJAN_DISTRIBUTIONCRITTrojanized binary download + execute (.md)
13SUSPICIOUS_PASTE_URLHIGHPaste-site URLs (pastebin, glot.io)
14SUSPICIOUS_IPMEDHardcoded public IPv4 addresses
15SOCIAL_ENGINEERINGMEDPressure language + exec instructions (.md)

The overall risk level rolls up to the highest severity in any finding: any CRITICAL → CRITICAL, else any HIGH → HIGH, else any MEDIUM → MEDIUM, else LOW.

Output

## Nio Execution Risk Scan Report

**Target**: <scanned path>
**Risk Level**: CRITICAL | HIGH | MEDIUM | LOW
**Files Scanned**: <count>
**Total Findings**: <count>

### Findings

| # | Risk Tag | Severity | File:Line | Evidence |
|---|----------|----------|-----------|----------|
| 1 | SHELL_EXEC | high | path/file.ts:42 | `child_process.exec(...)` |

### Summary
<Human-readable summary of key risks and recommendations>

Customize or extend rules with guard.file_scan_rules.<module> in config — see Config reference.