Back to skill

Security audit

Sharkflow

Security checks for vulnerabilities and agentic risk

Overview

The skill is not malicious, but it asks users to run unpinned external code for a high-impact DeFi automation workflow and has a local template deletion flaw.

Install only after reviewing or pinning the exact package version, preferably in a restricted environment without wallet secrets. Treat any future real transaction execution as high risk: use dry-run first, verify contract addresses and amounts, require explicit signing confirmation, and avoid using the template delete command with untrusted template IDs.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/template.mjs:86
Finding

Path Traversal Allows Deletion of JSON Files Outside the Templates Directory

Content
View full analysis

Vulnerability Details

File Location: scripts/template.mjs, lines 86-93 and 234-237
Vulnerability Type: Unvalidated path traversal in a file deletion operation
Risk Level: Medium

Vulnerable Code

js
// Delete template
function deleteTemplate(id) {
    const file = path.join(TEMPLATES_DIR, `${id}.json`);
    if (fs.existsSync(file)) {
        fs.unlinkSync(file);
        console.log(`✅ Template "${id}" deleted`);
    } else {
        console.log(`❌ Template "${id}" does not exist`);
    }
}

The value passed to this function comes directly from a command-line argument:

js
} else if (deleteIndex > -1) {
    deleteTemplate(args[deleteIndex + 1]);
} else {
    listTemplates();
}

Technical Analysis

The --delete argument is used as the template identifier without validation. The application appends .json and passes the result to path.join():

js
path.join(TEMPLATES_DIR, `${id}.json`)

path.join() normalizes traversal components such as ../; it does not guarantee that the resulting path remains under TEMPLATES_DIR. An identifier containing enough parent-directory components can therefore resolve to a JSON file outside the intended templates directory.

Once the path is resolved, fs.unlinkSync() deletes the selected file using the privileges of the user running the process. There is no canonical-path containment check, allowlist validation, or confirmation prompt.

The mandatory .json suffix limits direct exploitation to paths ending in .json, but potentially sensitive JSON configuration, credential, wallet, application-state, and package files remain exposed.

Attack Path

  1. An attacker identifies a JSON file accessible to the victim's operating-system account.
  2. The attacker constructs a relative path from the project's templates directory to that file, omitting its .json suffix.
  3. The attacker convinces a user or aut ...[truncated 1095 chars]
Remediation
View remediation

Remediation Suggestions

Restrict template identifiers to a conservative allowlist and verify that the resolved path remains inside the templates directory.

js
function resolveTemplatePath(id) {
    if (typeof id !== 'string' || !/^[A-Za-z0-9_-]+$/.test(id)) {
        throw new Error('Invalid template ID');
    }

    const base = path.resolve(TEMPLATES_DIR);
    const target = path.resolve(base, `${id}.json`);

    if (path.dirname(target) !== base) {
        throw new Error('Template path escapes the templates directory');
    }

    return target;
}

function deleteTemplate(id) {
    const file = resolveTemplatePath(id);

    if (!fs.existsSync(file)) {
        console.log(`Template "${id}" does not exist`);
        return;
    }

    fs.unlinkSync(file);
    console.log(`Template "${id}" deleted`);
}

Additional hardening should include:

  • Rejecting missing command-line values explicitly.
  • Applying the same path-validation helper to all template read and write operations.
  • Avoiding symlink traversal by inspecting the target with lstatSync() and refusing symbolic links.
  • Considering an interactive confirmation before destructive deletion.
  • Running the application with only the filesystem permissions it requires.
  • Adding tests covering ../, absolute paths, encoded separators, platform-specific separators, and symlink targets.

T08 · Insecure Dependencies

Warning
Location
README.md:27
Finding

Unpinned npx Command Downloads and Executes Code Outside the Audited Artifact

Content
View full analysis

Vulnerability Details

File Location: README.md, lines 27-30; SKILL.md, lines 39-43
Vulnerability Type: Unpinned third-party package retrieval and execution
Risk Level: Medium

Vulnerable Code

README.md contains the following Quick Start instruction:

bash
# Install
npx @gztanht/sharkflow

SKILL.md provides the same instruction:

bash
npx @gztanht/sharkflow

Technical Analysis

npx may retrieve a package from the configured npm registry and execute its package-provided command. The instruction does not specify an exact package version or an integrity digest.

The executed registry artifact is external to the reviewed project directory and can change after this local artifact has been audited. Consequently, users following the documented installation procedure may execute code that is not represented by the reviewed scripts/flow.mjs and scripts/template.mjs files.

The local package manifest is named sharkflow, while the documented command references the scoped package @gztanht/sharkflow. The audit history does not establish that the external scoped package is malicious. The security issue is that its contents and future versions are not pinned or verifiable from this artifact.

Attack Path

  1. A user follows the installation instructions in README.md or SKILL.md.

  2. The user runs:

    bash
    npx @gztanht/sharkflow
    
  3. npx resolves the current applicable release from the user's configured npm registry and may download it into the local npm cache.

  4. npx executes the package's exposed command with the user's privileges.

  5. If the package, publisher account, registry resolution, or a future release has been compromised, attacker-controlled package code executes locally.

This path depends on compromise or malicious modification of the external package supply chain; no such compromise was established during this audit.

Impact Ass

...[truncated 649 chars]

Remediation
View remediation

Remediation Suggestions

  • Avoid executing a dynamically resolved registry package as the default installation procedure.

  • If npm distribution is required, pin an exact reviewed version rather than allowing version drift:

    bash
    npx --yes @gztanht/sharkflow@0.2.0
    
  • Publish and document package provenance, release hashes, and npm provenance attestations.

  • Ensure the published scoped package is built reproducibly from the reviewed repository and release tag.

  • Provide a lockfile with integrity metadata for third-party dependencies.

  • Recommend installation followed by explicit execution rather than combining retrieval and execution in one command.

  • For use directly from the audited artifact, document local commands such as:

    bash
    npm ci
    node scripts/flow.mjs
    
  • Remove unused dependencies, including node-fetch if it remains unused, to reduce supply-chain exposure.

  • Run package installation and first execution in a restricted environment without wallet secrets or privileged credentials.

Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The skill explicitly promotes auto-executing scheduled on-chain actions such as DCA and auto-compounding. Autonomous execution is risky in this context because mistakes, compromised configuration, or manipulated task definitions can trigger real financial transactions without contemporaneous human review, increasing the chance of fund loss.

Content

Scanner excerpt · README.md (reported line 17)May include surrounding context.

md
- **Task Queues** - Batch multiple on-chain operations
- **Multisig Support** - Safe/multi-signature wallet workflows
- **Scheduled Tasks** - Auto-execute at set times (DCA, auto-compound)
- **History Tracking** - Complete task execution logs
- **Completion Alerts** - Telegram/email notifications
- **Template System** - Save reusable operation templates

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The README instructs users to run an unpinned package directly via npx, which fetches and executes the latest published code at install/run time. In a blockchain automation skill, that creates a significant supply-chain risk: a compromised publisher account or malicious update could execute arbitrary code or manipulate wallet/transaction workflows on user systems.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 91)May include surrounding context.

md
| Command | Description |
|---------|-------------|
| `flow.mjs add` | Add task to queue |
| `flow.mjs execute` | Execute queued tasks |
| `flow.mjs execute --dry-run` | Preview without submitting |
| `flow.mjs schedule` | Set scheduled task |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly promotes queued execution, multisig workflows, and scheduled automated on-chain transactions, but it does not prominently warn that these actions can move real funds, incur gas costs, or execute at unfavorable market conditions. In DeFi automation, omission of risk disclosures is dangerous because users may treat examples as low-risk operational guidance and enable recurring or batch actions that cause irreversible financial loss.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The installation command uses npx @gztanht/sharkflow without pinning an exact version or integrity source, so users will fetch and execute whatever package version is current at runtime. In a skill that automates on-chain actions, this materially increases supply-chain risk because a compromised or malicious package update could immediately lead to wallet-draining transactions or unsafe contract interactions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's user-facing description and all CLI guidance are written in Chinese, which implies a fixed language experience for users. Under the policy, language constraints should either provide user choice or be explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description, headings, feature explanations, and usage guidance are presented in Chinese, but the file does not indicate that the skill is China-specific or provide an opt-in for language preference. This can violate a language/locale policy when users are not given a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The package description is written entirely in Chinese, which can impose a language preference on users without offering an alternative or opt-in. The policy specifically calls for flagging language or locale constraints when they are forced rather than optional or justified.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dependency version is specified with a caret range (^3.3.2), which allows future minor/patch releases to be installed. In a security-sensitive automation skill that may interact with blockchain workflows, this weakens supply-chain reproducibility and can unexpectedly introduce a vulnerable or malicious upstream release into execution environments.

Content

Scanner excerpt · package.json (reported line 26)May include surrounding context.

json
"author": "@gztanht",
  "license": "MIT",
  "dependencies": {
    "node-fetch": "^3.3.2"
  },
  "repository": {
    "type": "git",

Unverifiable Dependency: node-fetch has 3 known advisory(ies) (CVE-2022-0235 (node-fetch forwards secure headers to untrusted sites); CVE-2022-2596 (node-fetch Inefficient Regular Expression Complexity ); CVE-2020-15168 (The `size` option isn't honored after following a redirect in node-fetch)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

The manifest references node-fetch without an exact pin, while known advisories exist in some node-fetch releases. Because the installed version is not strictly fixed, consumers cannot verify from this manifest alone whether deployment will resolve to a patched release, which is a supply-chain and dependency hygiene risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The script emits user-facing text in a mixed language format, including Chinese status and feature descriptions, but provides no option to select or change the language/locale. This can violate a language-choice policy when users are implicitly forced into a specific locale without opt-in.

Content

No source excerpt is available for this finding.