Back to skill

Security audit

Aagent System

Security checks for vulnerabilities and agentic risk

Overview

This security-research skill is mostly purpose-aligned, but it runs unreviewed local shell scripts and can create long-running collection processes without hard limits.

Review carefully before installing. Use only in a sandboxed research environment with network and process limits, and only after independently reviewing or replacing the referenced ~/aass-dataset and ~/aass-scripts shell scripts. Expect continuous outbound registry requests and persistent local dataset writes.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (3)

T07 · Tool Hijacking and Spoofing

Error
Location
agents/scanner/agent.cjs:8
Finding
Execution of Unverified Shell Scripts Outside the Audited Skill Package<![CDATA[ ## Vulnerability Details **File Location**: `agents/scanner/agent.cjs:8-11`, `agents/analyzer/agent.cjs:9`, `agents/researcher/agent.cjs:9` **Vulnerability Type**: Execution of unverified external tools **Risk Level**: High ### Vulnerable Code ```javascript // agents/scanner/agent.cjs:8-11 async function scan(){ try{ await new Promise((r,e)=>exec('~/aass-dataset/secure_dataset.sh scan 2>&1',{timeout:180000},(ex,out)=>ex?e(ex):r(out))); log('扫描完成'); ``` ```javascript // agents/analyzer/agent.cjs:9 await new Promise((r,e)=>exec('~/aass-scripts/3layer_scheduler.sh analyzer 2>&1',{timeout:300000},(ex,out)=>ex?e(ex):r(out))); ``` ```javascript // agents/researcher/agent.cjs:9 await new Promise((r,e)=>exec('~/aass-scripts/daily_intel.sh 2>&1',{timeout:600000},(ex,out)=>ex?e(ex):r(out))); ``` ### Technical Analysis The scanner, analyzer, and researcher agents execute shell scripts stored outside the audited project. These scripts are not included in the Skill, and the reviewed code does not validate their ownership, permissions, integrity, or expected contents before execution. The documented manager starts all three affected agent types. Consequently, invoking the normal start operation can execute code whose effective behavior is not represented by the reviewed package. The use of `child_process.exec` additionally invokes a shell, expanding the execution surface beyond what is required to launch a fixed local program. This is a local tool-hijacking risk: an attacker or compromised process capable of creating or replacing one of the referenced scripts can cause attacker-controlled commands to run under the identity of the user operating the Skill. No privilege escalation beyond that user's existing permissions is demonstrated. ### Attack Path 1. An attacker obtains write access to the current user's `~/aass-dataset` or `~/aass-scripts` directory, or creates the expected path before the legitimate component is installed. 2. The attacker pl ...[truncated 1029 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Package all required scanner, analyzer, and researcher implementations inside the audited Skill. 2. Resolve executable paths from `__dirname` rather than from mutable home-directory locations. 3. Replace `exec` with `spawn` or `execFile`, disable shell interpretation, and pass arguments as an array. 4. Before execution, validate that each executable: - Is a regular file rather than a symbolic link. - Is owned by the expected user or package owner. - Is not writable by untrusted users or groups. - Matches a cryptographically pinned hash or signed manifest. 5. Fail closed when integrity validation fails; do not silently substitute another executable. 6. Document every external component and its required permissions. 7. Run analysis components in a restricted subprocess or container with minimal filesystem and network access. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
bin/agent-manager.cjs:90
Finding
Unvalidated PID Files Can Terminate Unrelated Processes<![CDATA[ ## Vulnerability Details **File Location**: `bin/agent-manager.cjs:90-94` **Vulnerability Type**: Untrusted PID-file handling **Risk Level**: Medium ### Vulnerable Code ```javascript for (let i = 0; i < 20; i++) { const pidFile = path.join(DATA, `${name}-${i}.pid`); try { process.kill(parseInt(fs.readFileSync(pidFile, 'utf8'))); } catch {} try { fs.unlinkSync(pidFile); } catch {} } ``` ### Technical Analysis The stop operation treats each PID-file value as authoritative. It parses the stored value and sends the default termination signal without verifying that: - The value is a valid positive process identifier. - The process is owned by the current user. - The process executable is Node.js. - The process command line corresponds to the expected agent script. - The process is the same process originally created by this manager. PID values are reusable. A stale PID file may therefore refer to an unrelated process after the original agent exits. In addition, any process capable of modifying files in the project data directory can insert a chosen PID. The broad exception handlers suppress all validation and operational errors, making incorrect process termination difficult to detect. ### Attack Path 1. An attacker with write access to the Skill's `data` directory creates or modifies a managed PID file such as `data/collector-0.pid`. 2. The attacker writes the PID of another process owned by the Skill user into that file. 3. Alternatively, an existing PID file becomes stale and the operating system reuses its PID for an unrelated process. 4. The user runs the documented `stop` operation. 5. `stopAll()` reads the untrusted or stale PID and calls `process.kill()` without checking process identity. 6. The unrelated process receives a termination signal. ### Impact Assessment Exploitation can terminate arbitrary processes that the Skill user is permitted to signal. This may interrupt user applications, development tools, or other services and ...[truncated 238 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate PID-file contents with a strict positive-integer check before using them. 2. Store additional process identity information, including: - Agent name and script path. - Process start time. - A manager-generated random identifier. 3. Before signaling a PID, inspect operating-system process metadata such as `/proc/<pid>/cmdline`, `/proc/<pid>/stat`, and ownership. 4. Confirm that the command line matches the exact expected agent script and that the start time matches the stored record. 5. Create PID files atomically with restrictive permissions and reject symbolic links. 6. Delete stale PID files without signaling a process when identity verification fails. 7. Prefer maintaining live child-process handles in the manager rather than relying exclusively on reusable numeric PIDs. 8. Report validation and termination failures instead of suppressing every exception. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
agents/evolver/agent.cjs:143
Finding
Autonomous Collector Scaling Lacks a Hard Resource Limit<![CDATA[ ## Vulnerability Details **File Location**: `agents/evolver/agent.cjs:143-164`, `agents/evolver/agent.cjs:209-244` **Vulnerability Type**: Unbounded process creation and resource consumption **Risk Level**: High ### Vulnerable Code ```javascript async function applyStrategy(strategy) { log(`🔧 执行优化: ${strategy.action}`); switch (strategy.action) { case '增加采集器': config.collectors = strategy.param.collectors; // 启动新采集器 for (let i = 0; i < 5; i++) { const { exec } = require('child_process'); exec(`cd ${DATA_DIR}/../../ && AGENT_NAME=collector AGENT_INDEX=${Date.now()+i} node agents/collector/agent.cjs > /dev/null 2>&1 &`); } break; ``` ```javascript let round = 0; while (true) { round++; log(`\n=== 演进轮次 ${round} ===`); const metrics = collectMetrics(); const gaps = analyzeGap(metrics); const strategies = generateStrategy(gaps, metrics); if (strategies.length > 0) { const applied = []; for (const strategy of strategies.slice(0, 2)) { try { await applyStrategy(strategy); applied.push(strategy); } catch (e) { log(`❌ 执行失败: ${e.message}`); } } } await new Promise(r => setTimeout(r, 60000)); } ``` ### Technical Analysis When collection throughput is considered inadequate, the evolver increases the configured collector count and starts five additional collector processes. The main evaluation loop repeats indefinitely. No hard upper bound is enforced for `config.collectors`, and the code does not reconcile the configured count with the processes that are already running. It also lacks CPU, memory, storage, file-descriptor, and network-rate checks before creating more workers. The background processes are launched through a shell and their handles are not retained for lifecycle management. This agent is not started by the documented `bin/agent-manager.cjs` workflow, so the vulnerable behavior requires the evolver to be launched ...[truncated 1573 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Define and enforce a conservative hard maximum for collector processes. 2. Before scaling, determine the actual set of managed collector processes and reconcile it with the desired count. 3. Check CPU, memory, free storage, file descriptors, and recent request rates before adding workers. 4. Apply exponential backoff and a cooldown period after unsuccessful scaling. 5. Stop scaling when external services are unavailable or returning rate-limit responses. 6. Use `spawn` without a shell and retain child-process handles for monitoring and termination. 7. Introduce a single supervisor responsible for process lifecycle management rather than allowing the evolver to create unmanaged background processes. 8. Use file locking, a transactional database, or a single-writer architecture for shared sample and statistics data. 9. Require explicit administrative configuration before enabling autonomous scaling. 10. Emit an alert and fail safely when configured or observed worker counts exceed the approved limit. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (56)

YARA rule 'crypto_coinjacking': Browser-based cryptojacking scripts (CoinHive, CryptoLoot, etc.) [cryptominers]

Critical
Category
YARA Match
Content
"npm-registry",
    "keyword": "miner",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "0",
    "at": "2026-03-01T03:08:05.431Z",
    "risk": "critical",
    "flags": [
      "恶意关键词: miner"
    ],
    "scannedAt": "2026-03-01T03:08:14.377Z"
  },
  {
    "name": "jse-cli-miner",
    "version": "1.0.6",
    "description": "A very simple and lightweight cli cpu miner for JSECoin's platform mining.",
    "source": "npm-registry",
    "keyword": "miner",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "0",
    "at": "2026-03-01T03:08:05.438Z",
    "risk": "critical",
    "flags": [
      "恶意关键词: miner"
    ],
    "scannedAt": "2026-03-01T03:08:14.377Z"
  },
  {
    "name": "rustchainpoa",
    "version": "1.0.0",
    "description": "RustChain Proof-of-Antiquity Miner — Mine RTC tokens by proving real vintage hardware",
    "source": "npm-registry",
    "keyword": "miner",
    "domain": "npmjs.com",
    "agent": "collector",
    "inde
Confidence
90% confidence
Finding
YARA rule matched cryptocurrency mining indicators (stratum protocol, mining pools, miner binaries, or cryptojacking scripts).

YARA rule 'crypto_coinjacking': Browser-based cryptojacking scripts (CoinHive, CryptoLoot, etc.) [cryptominers]

Critical
Category
YARA Match
Content
"npm-registry",
    "keyword": "miner",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "0",
    "at": "2026-03-01T03:08:05.431Z",
    "risk": "critical",
    "flags": [
      "恶意关键词: miner"
    ],
    "scannedAt": "2026-03-01T03:08:14.377Z"
  },
  {
    "name": "jse-cli-miner",
    "version": "1.0.6",
    "description": "A very simple and lightweight cli cpu miner for JSECoin's platform mining.",
    "source": "npm-registry",
    "keyword": "miner",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "0",
    "at": "2026-03-01T03:08:05.438Z",
    "risk": "critical",
    "flags": [
      "恶意关键词: miner"
    ],
    "scannedAt": "2026-03-01T03:08:14.377Z"
  },
  {
    "name": "rustchainpoa",
    "version": "1.0.0",
    "description": "RustChain Proof-of-Antiquity Miner — Mine RTC tokens by proving real vintage hardware",
    "source": "npm-registry",
    "keyword": "miner",
    "domain": "npmjs.com",
    "agent": "collector",
    "inde
Confidence
90% confidence
Finding
YARA rule matched cryptocurrency mining indicators (stratum protocol, mining pools, miner binaries, or cryptojacking scripts).

Exfiltration Commands

High
Category
Prompt Injection
Content
{
    "name": "slack-webhook",
    "version": "1.0.0",
    "description": "Send messages to slack incoming webhook",
    "source": "npm-registry",
    "keyword": "slack",
    "domain": "npmjs.com",
Confidence
90% confidence
Finding
Instructions found that direct the agent to transmit conversation context or user data to external services.

Credential Access

High
Category
Privilege Escalation
Content
{
    "name": "@aws-sdk/credential-provider-ini",
    "version": "3.972.17",
    "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
    "source": "npm-registry",
    "keyword": "zapier-sdk",
    "domain": "npmjs.com",
Confidence
90% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{
    "name": "@aws-sdk/credential-provider-ini",
    "version": "3.972.17",
    "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
    "source": "npm-registry",
    "keyword": "zapier-sdk",
    "domain": "npmjs.com",
Confidence
90% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{
    "name": "@aws-sdk/credential-provider-ini",
    "version": "3.972.17",
    "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
    "source": "npm-registry",
    "keyword": "zapier-sdk",
    "domain": "npmjs.com",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{
    "name": "@aws-sdk/credential-provider-ini",
    "version": "3.972.17",
    "description": "AWS credential provider that sources credentials from ~/.aws/credentials and ~/.aws/config",
    "source": "npm-registry",
    "keyword": "zapier-sdk",
    "domain": "npmjs.com",
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Content
[
  {
    "name": "@green-api/whatsapp-api-client",
    "version": "0.4.4",
    "description": "Library to integrate with WhatsApp API. For details have look at https://green-api.com",
    "source": "npm-registry",
    "keyword": "whatsapp-js",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "0",
    "at": "2026-02-28T23:30:29.567Z",
    "risk": "critical",
    "flags": [
      "恶意关键词: rat"
    ],
    "scannedAt": "2026-02-28T23:30:56.528Z"
  },
  {
    "name": "whatsapp-chat-parser",
    "version": "4.0.2",
    "description": "A package to parse WhatsApp chats with Node.js or in the browser 💬",
    "source": "npm-registry",
    "keyword": "
Confidence
80% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

YARA rule 'agent_skill_prompt_injection_hidden_instructions': Prompt injection or hidden instructions embedded in AI agent skill text [agent_skills]

High
Category
YARA Match
Content
hats with Node.js or in the browser 💬",
    "source": "npm-registry",
    "keyword": "whatsapp-js",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "0",
    "at": "2026-02-28T23:30:29.567Z",
    "risk": "low",
    "flags": [],
    "scannedAt": "2026-02-28T23:30:56.529Z"
  },
  {
    "name": "ai-fallback",
    "version": "2.0.0",
    "description": "Automatically switch AI SDK model provider when one of the providers has downtime",
    "source": "npm-registry",
    "keyword": "openai-ai",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "1",
    "at": "2026-02-28T23:30:29.567Z",
    "risk": "low",
    "flags": [],
    "scannedAt": "2026-02-28T23:30:56.529Z"
  },
  {
    "name": "@vercel/detect-agent",
    "version": "1.1.0",
    "description": "Detect if code is running in an AI agent or automated development environment",
    "source": "npm-registry",
    "keyword": "openai-ai",
    "domain": "npmjs.com",
    "agent": "collector",
    "index": "1",
Confidence
80% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
该 markdown 文档的标题、说明、规则和操作指引均以中文固定呈现,没有提供用户可选择的语言版本,也没有说明该技能仅面向中文环境或特定区域。根据规则,若技能强制特定语言而无用户 opt-in 或明确合理的地域性说明,属于自然语言政策违规。

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill advertises operational behavior that implies network access and possible environment usage, but it does not declare any explicit tool scope or permissions. This creates a transparency and governance gap: users and enforcement systems cannot clearly understand or constrain what the skill may access before execution.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill description says it automatically collects samples from external sources and performs security scanning, but it does not warn users about autonomous external interactions, data retrieval, or potential processing of untrusted content. This is dangerous because users may trigger internet-facing collection and analysis activity without informed consent or understanding of operational, legal, or safety implications.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The code launches an external shell script via exec, which is a safety-relevant operation because it can execute arbitrary system actions outside this file. Although there are generic log messages before and after execution, there is no disclosure of what command is being run or what effects it may have, and no inline comment or docstring explaining the action.

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
The file contains multiple natural-language comments and runtime log strings in Chinese, such as startup/progress messaging, with no indication that the language is configurable or intentionally limited to a Chinese-speaking context. Under the language/locale policy, forcing a specific language without user opt-in or clear justification is a policy concern.

Context-Inappropriate Capability

Medium
Confidence
89% confidence
Finding
The manifest describes a multi-agent system for sample collection, security scanning, threat intelligence, and research analysis. While network collection is expected, invoking a local subprocess to run `npm search` adds command-execution capability that is broader and more sensitive than the stated purpose requires, especially since the primary collection path already uses the npm registry HTTP API.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This code invokes a shell command using `exec` to run `npm search`, which is a safety-relevant operation for code files. While the skill logs counts and errors, there is no explicit disclosure near the operation explaining that an external subprocess will be launched, and no confirmation prompt before doing so.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The natural-language instructions in the file header are entirely in Chinese and present the agent's role and responsibilities in that language without offering any user language choice or noting a region-specific constraint. Under the policy, forcing a specific language without opt-in is a language/locale policy violation.

Intent-Code Divergence

Medium
Confidence
86% confidence
Finding
The file header presents the component as a self-assessment and optimization module, but the implementation also launches new agent processes. This capability mismatch is security-relevant because operators may grant trust or permissions based on the documented purpose, not realizing the module can autonomously expand execution scope.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The agent directly executes shell commands to spawn background collector processes, expanding its capabilities from analysis/optimization into uncontrolled process creation. In a self-modifying or self-optimizing system, this can lead to unbounded process growth, resource exhaustion, and unauthorized task execution, especially because the launch is automatic and detached.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
Background agents are started silently and asynchronously without user notification, confirmation, or audit-oriented controls. Hidden process creation makes abuse and accidental runaway behavior harder to detect, and in this context it can multiply collectors over time as the evolver repeatedly optimizes for speed.

Natural-Language Policy Violations

Medium
Confidence
82% confidence
Finding
The natural-language comments and identifier text present the skill description entirely in Chinese, indicating a fixed language choice without offering a user-selectable locale or documenting a region-specific justification. This can violate language or locale policy when skills are expected to avoid forcing a language without opt-in.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The agent enters an unbounded collection loop, continuously makes outbound requests to the npm registry, and persistently writes discovered package metadata to a local JSON file without any consent gate, rate-limit policy, shutdown condition, or clear disclosure in the code path. In a sample-collection/security-research skill this behavior may be intended, but it still creates operational and privacy/governance risk because it can generate persistent network activity and local data accumulation that users may not expect.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The file's human-readable description, comments, and status messages are written in Chinese throughout, with no indication that language selection is optional or region-specific. This can violate language/locale policy when a skill effectively mandates a single language without user opt-in.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The orchestrator launches background processes via a shell command using child_process.exec and immediately detaches them with output suppressed, without any user confirmation, visibility, or process ownership controls. In the context of a multi-agent automation system that can start multiple roles automatically and restart them in a loop, this behavior creates stealthy persistent execution and makes abuse, runaway spawning, or unauthorized resource consumption significantly more dangerous.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The file’s natural-language description and user-facing log strings are in Chinese, and the skill does not offer any language selection or explain that it is intentionally limited to a Chinese-speaking context. This can violate a language/locale policy requiring user choice or explicit justification for locale-specific behavior.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.dynamic_code_execution, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
agents/analyzer/agent.cjs:9

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
agents/collector/agent.cjs:110

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
agents/evolver/agent.cjs:162

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
agents/orchestrator/agent.cjs:42

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
agents/researcher/agent.cjs:9

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
agents/scanner/agent.cjs:10

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
bin/agent-manager.cjs:38

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
agents/designer/agent.cjs:61

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
agents/collector/agent.cjs:3

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
agents/ultra-collector/agent.cjs:8