Back to skill

Security audit

Agent Entropy Meter

Security checks for vulnerabilities and agentic risk

Overview

This skill is a small local metrics library for agent-message entropy and overlap, with some robustness bugs but no evidence of hidden access, persistence, exfiltration, or destructive behavior.

This skill is reasonable to install for local analysis of agent message categories. Treat its output cautiously with untrusted or unusual category names until the Set-handling and prototype-key robustness bugs are fixed; malformed input may crash a report or produce incorrect overlap metrics.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:48
Finding

Prototype-Key Collision Allows Denial of Service Through Crafted Message Categories

Content
View full analysis
c / total); } ``` ```js function jointDistribution(msgsA, msgsB, allCategories) { const n = allCategories.length; const catIndex = {}; allCategories.forEach((c, i) => { catIndex[c] = i; }); // Initialize joint count matrix const jointCounts = Array.from({ length: n }, () => new Array(n).fill(0)); const countA = new Array(n).fill(0); const countB = new Array(n).fill(0); const minLen = Math.min(msgsA.length, msgsB.length); for (let i = 0; i < minLen; i++) { const idxA = catIndex[msgsA[i]]; const idxB = catIndex[msgsB[i]]; if (idxA !== undefined && idxB !== undefined) { jointCounts[idxA][idxB]++; countA[idxA]++; countB[idxB]++; } } ``` ### Technical Analysis The implementation uses ordinary JavaScript objects as dictionaries for message categories. Ordinary objects inherit properties from `Object.prototype`. Consequently, attacker-controlled category names such as `__proto__`, `constructor`, or `toString` can resolve to inherited values rather than the numeric values expected by the code. In `jointDistribution()`, an inherited value obtained through `catIndex[msgsA[i]]` or `catIndex[msgsB[i]]` is not `undefined`, so it passes the existing validation. The value is then used as an array index: ```js jointCounts[idxA][idxB]++; ``` Because the inherited value is not a valid numeric matrix index, `jointCounts[idxA]` can be `undefined`, resulting in a `TypeError` when the second index is accessed. The exception is not handled by `j ...[truncated 1643 chars]
Remediation
View remediation
count / total); } ``` ```js const categoryIndex = new Map(); allCategories.forEach((category, index) => { categoryIndex.set(category, index); }); const idxA = categoryIndex.get(msgsA[i]); const idxB = categoryIndex.get(msgsB[i]); if (Number.isInteger(idxA) && Number.isInteger(idxB)) { jointCounts[idxA][idxB]++; countA[idxA]++; countB[idxB]++; } ``` 2. If plain objects must be retained, create dictionaries with `Object.create(null)` and verify keys with `Object.hasOwn()` before using retrieved values. 3. Validate that `msgsA`, `msgsB`, and `allCategories` are arrays and that every category is an accepted primitive type, preferably a string. 4. Confirm that every resolved category index is an integer in the range `0 <= index < allCategories.length` before indexing matrices. 5. Add defensive exception handling at the application boundary so malformed analysis input cannot terminate the hosting process. 6. Add regression tests covering at least: - `__proto__` - `constructor` - `prototype` - `toString` - empty category arrays - non-string categories - categories absent from `allCategories` ]]>
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The 'When to Use' section specifies a trigger phrase only in Chinese, which can impose a language-specific invocation pattern without any user opt-in or explanation that the skill is intended for Chinese-language contexts. This is a natural-language policy concern because the file does not offer alternative language choices or justify the locale constraint.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The docstring at L130-L132 says knowledgeOverlap accepts string[]|Set for both parameters, but the implementation at L135-L136 only preserves array inputs and converts any non-array input, including a real Set, into an empty Set. This is an active contradiction between the documented intent and actual behavior, and can silently produce incorrect 0-overlap results when callers pass Sets as documented.

Content

No source excerpt is available for this finding.