Back to skill

Security audit

@blockchain-forever/aelf-skills

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent aelf skill installer hub, but its bootstrap path can delete unintended directories from catalog-controlled IDs and runs dependency installation on downloaded third-party code by default.

Install only if you trust the catalog and upstream skill packages. Prefer `--skip-install`, avoid custom catalogs from untrusted sources, use a disposable destination directory, and review any downloaded skill before running setup or blockchain write operations such as transfers, approvals, swaps, trades, or contract sends.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/bootstrap.ts:267
Finding

Unverified Remote Code Is Downloaded and Executed During Bootstrap

Content
View full analysis
value.trim()) .filter(Boolean); const tarballName = lines[lines.length - 1]; const tarballPath = path.join(tmpDir, tarballName); const extractResult = runCommand('tar', ['-xzf', tarballPath, '-C', targetDir, '--strip-components=1']); if (!extractResult.ok) { return { ok: false, message: extractResult.stderr || extractResult.stdout || `tar extract failed for ${packageRef}`, }; } rmSync(tmpDir, { recursive: true, force: true }); return { ok: true, message: `downloaded via npm: ${packageRef}`, }; } function downloadViaGithub(skill: SkillCatalogEntry, targetDir: string): { ok: boolean; message: string } { if (!skill.repository.https) { return { ok: false, message: 'repository.https is missing', }; } const cloneResult = runCommand('git', ['clone', '--depth', '1', skill.repository.https, targetDir]); if (!cloneResult.ok) { return { ok: false, message: cloneResult.stderr || cloneResult.stdout || `git clone failed for ${skill.repository.https}`, }; } return { ok: true, message: `downloaded via github: ${skill.repository.https}`, }; } function installSkillDependencies(skillDir: str ...[truncated 2795 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/bootstrap.ts:189
Finding

Catalog-Controlled Skill ID Can Escape the Destination and Trigger Recursive Deletion

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
Read `skills-catalog.json` for the full machine-readable registry. Current skills:

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/lib/utils.ts (reported line 34)May include surrounding context.

ts
): CommandResult {
  const child = spawnSync(command, args, {
    cwd,
    env: env ? { ...process.env, ...env } : process.env,
    stdio: 'pipe',
    encoding: 'utf8',
  });

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
78% confidence
Finding

The skill provides operational shell commands and setup workflows that imply execution and environment interaction, but it does not declare an explicit tool scope such as permissions or allowed-tools. In a meta-skill that bootstraps and configures other skills, this ambiguity can cause an agent to overreach, invoke unintended tools, or operate with broader access than the user expects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The bootstrap flow unconditionally deletes targetDir with rmSync(..., { recursive: true, force: true }) and recreates it, which can destroy existing local content without confirmation or path safety checks. In a tool whose purpose is to download and bootstrap many skills into a user-supplied destination, this increases the chance of accidental data loss if a catalog entry, skill ID, or destination path is wrong or manipulated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Running bun install on freshly downloaded skill content executes package-manager install behavior on untrusted third-party code, which can trigger lifecycle scripts or other dependency-fetch side effects. In this skill hub context, the script is explicitly designed to fetch code from npm/GitHub/local catalogs, so it meaningfully expands the attack surface to arbitrary code execution on the operator's machine if a package, repository, or catalog entry is compromised.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a hub for discovering, installing, routing, and auditing aelf skills. While some command invocation may be expected for installation workflows, this utility exposes a reusable arbitrary command runner and command-existence checker over any binary, which is a broader capability than the file's documented hub-oriented purpose justifies on its own.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The runCommand function executes subprocesses via spawnSync, which is a safety-relevant operation for code files. In this file there is no confirmation prompt, logging, print statement, or explanatory comment/docstring disclosing that commands will be executed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The catalog advertises skills capable of transfers, swaps, approvals, contract execution, and other asset-moving operations, but the manifest provides no explicit warning that these actions may be irreversible or financially risky. In a discovery/install hub, this omission can cause users or downstream agents to treat high-risk skills like ordinary read-only utilities, increasing the chance of unintended wallet actions or unsafe automated routing.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · docs/CATALOG_SCHEMA.md (reported line 79)May include surrounding context.

md
Recommended style:
1. Start with action verbs (for example `Query block status`, `Create wallet`).
2. One capability sentence should describe one action.
3. Avoid vague wording such as `handle everything`.
4. Include boundary hints such as `read-only` and `simulate/send`.

## 6. Modes and compatibility

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The writeJsonFile function creates directories and writes files, which is a safety-critical filesystem modification under the audit criteria. This code includes no user-facing notice, confirmation, or explanatory comment/docstring indicating that it will write to disk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The manifest focuses on listing, installing, routing, and auditing skills. This helper reads process environment variables from caller-supplied path templates, which introduces access to host configuration data beyond the core parsing and manifest-handling responsibilities shown elsewhere in the file.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/lib/utils.ts:32