Back to skill

Security audit

Customer Segmentation

Security checks for vulnerabilities and agentic risk

Overview

This skill matches its customer-segmentation purpose, but it handles CRM credentials and customer data with under-scoped local file access, unvalidated API destinations, and plaintext persistence.

Review before installing in any environment with real OKKI CRM access. Use least-privilege OKKI credentials, verify config.json points only to the intended HTTPS OKKI endpoints, protect the external OKKI workspace and .env files, and restrict or encrypt the generated data, logs, token cache, backups, and reports. Run tag sync in dry-run first and use --limit or --customer before any broad --confirm operation.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/customer-data-collector.js:76
Finding

OAuth credentials and bearer tokens can be transmitted to unrestricted configured origins

Content
View full analysis
0) { const qs = new URLSearchParams(params).toString(); url += `?${qs}`; } const options = { method, headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' } }; if (method === 'POST') { options.body = JSON.stringify(params); } const resp = await fetch(url, options); ``` `scripts/tag-sync.js:79-92`: ```js const config = getOkkiConfig(); const body = new URLSearchParams({ client_id: config.clientId, client_secret: config.clientSecret, grant_type: 'client_credentials', scope: config.scope }); const resp = await fetch(`${config.baseUrl}/v1/oauth2/access_token`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: body.toString() }); ``` `scripts/tag-sync.js:124-140`: ```js async function okkiGet(endpoint, token, baseUrl) { const resp = await fetch(`${baseUrl}${endpoint}`, { headers: { Authorization: token } }); if (!resp.ok) throw new Error(`OKKI GET ${endpoint} failed: ${resp.status}` ...[truncated 3218 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/customer-data-collector.js:94
Finding

Access tokens and sensitive CRM exports are stored in plaintext without explicit restrictive permissions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 9)May include surrounding context.

md
| `customer-data-collector.js` | — | OKKI API 增量采集客户数据 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

md
| `customer-data-collector.js` | — | OKKI API 增量采集客户数据 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 10)May include surrounding context.

md
| `scoring-engine.js` | — | 加权评分 + 自动分层(5 级) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
| `scoring-engine.js` | — | 加权评分 + 自动分层(5 级) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 28)May include surrounding context.

md
| `scoring-engine.js` | — | 加权评分 + 自动分层(5 级) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 11)May include surrounding context.

md
| `tag-sync.js` | 16KB | OKKI 标签同步(⚠️ 安全机制齐全) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 35)May include surrounding context.

md
| `tag-sync.js` | 16KB | OKKI 标签同步(⚠️ 安全机制齐全) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 36)May include surrounding context.

md
| `tag-sync.js` | 16KB | OKKI 标签同步(⚠️ 安全机制齐全) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
| `tag-sync.js` | 16KB | OKKI 标签同步(⚠️ 安全机制齐全) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 12)May include surrounding context.

md
| `strategy-output.js` | 13KB | 策略建议输出 + 升级机会识别 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 31)May include surrounding context.

md
| `strategy-output.js` | 13KB | 策略建议输出 + 升级机会识别 |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

md
| `strategy-output.js` | 13KB | 策略建议输出 + 升级机会识别 |

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The script explicitly loads a .env file from a parent directory and then reads CRM configuration and token cache files from an external workspace, giving this skill access to credentials and authentication material outside its own project boundary. In the context of a customer-data collection script, this is especially sensitive because it enables automated access to customer, order, and follow-up records and could expose secrets or facilitate broad data extraction if the script is run in a privileged environment.

Content

Scanner excerpt · scripts/customer-data-collector.js (reported line 22)May include surrounding context.

js
// ==================== 配置 ====================
const OKKI_WORKSPACE = process.env.OKKI_WORKSPACE || path.resolve(__dirname, '../../../xiaoman-okki');
const ENV_PATH = process.env.ENV_PATH || path.resolve(__dirname, '../../../.env');
const OKKI_CONFIG_PATH = path.join(OKKI_WORKSPACE, 'api/config.json');
const TOKEN_CACHE_PATH = path.join(OKKI_WORKSPACE, 'api/token.cache');

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/tag-sync.js (reported line 34)May include surrounding context.

js
// ==================== OKKI 认证 ====================
const OKKI_WORKSPACE = process.env.OKKI_WORKSPACE || path.resolve(__dirname, '../../../xiaoman-okki');
const ENV_PATH = process.env.ENV_PATH || path.resolve(__dirname, '../../../.env');
const OKKI_CONFIG_PATH = path.join(OKKI_WORKSPACE, 'api/config.json');
const TOKEN_CACHE_PATH = path.join(OKKI_WORKSPACE, 'api/token.cache');

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The substantive instructions and operational guidance are written in Chinese, and the file does not offer an alternative language or indicate that the skill is intentionally limited to Chinese-speaking users or a China-specific compliance context. This can violate a language/locale policy when users are not given an opt-in or choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JSON file contains user-facing natural-language content entirely in Chinese, including labels and customer-segmentation strategy descriptions. Because the file does not indicate that the skill is region-specific or offer any language/locale opt-in, it appears to enforce a specific language by default, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The help text says sample mode is only for testing the workflow, but the implementation may still write to data/scores-current.json when that file does not already exist. This can create persistent output derived from synthetic data and pollute later runs, baselines, or downstream processes that trust the presence of that file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file-level description and usage text state the skill generates strategy suggestions and summaries in Chinese, and later user-facing console/summary strings are also hard-coded in Chinese. There is no indication that users can choose another language or that the locale restriction is documented as a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

When --sample is used and the expected data file is missing, the script invokes scoring-engine.js via execSync, expanding this tool from a formatter/report generator into a process launcher. That creates an unnecessary execution path and inherits the current environment, so compromise or unexpected behavior in the sibling script can be triggered indirectly by running this script.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script documents a 500ms safety delay between API requests, but it calls sleep(API_INTERVAL_MS) without defining API_INTERVAL_MS anywhere. In confirm mode this causes a runtime exception before synchronization proceeds, defeating the stated safeguard and making the implementation inconsistent with operator expectations; if the variable were later introduced from untrusted scope, rate limiting behavior could also become unpredictable.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This manifest file includes a natural-language description only in Chinese, but does not indicate that the skill is intended exclusively for Chinese-speaking users or offer any language/locale choice. That can violate language/locale policy expectations when users are not given opt-in or documentation for the constraint.

Content

No source excerpt is available for this finding.