Back to skill

Security audit

AgentHansa Merchant

Security checks for vulnerabilities and agentic risk

Overview

This merchant CLI/MCP skill is mostly coherent, but it exposes a saved API key in export URLs and gives agents direct access to financially consequential account actions.

Review carefully before installing. Use only a pinned, trusted version, avoid running it in shared environments, prefer AGENTHANSA_MERCHANT_KEY over saved credentials where possible, rotate any key exposed through export URLs, and do not connect the MCP server to an autonomous agent unless you are comfortable with that agent performing merchant-account actions such as refunds, payouts, deletions, and winner selection.

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
index.js:194
Finding

Merchant API Key Exposed in Export URLs

Content
View full analysis
{ const key = getApiKey(); if (!key) return { error: "No API key" }; return { export_url: `${API_BASE}/api/alliance-war/quests/${args.quest_id}/export?api_key=${key}` }; }, ``` ### Technical Analysis The export handlers place the long-lived merchant API key directly in the `api_key` URL query parameter. The resulting URL is then returned through CLI output or an MCP tool response. Query strings routinely propagate into locations that are not appropriate for secrets, including: - CLI output and terminal logs - MCP transcripts and host-application logs - Browser history and bookmarks - Reverse-proxy, CDN, and web-server access logs - Monitoring and analytics systems - Screenshots, copied messages, and support records - Potential HTTP `Referer` headers when navigating from the exported report The same codebase already supports authenticated requests through an `Authorization: Bearer` header. Therefore, placing the credential in a URL is not the minimum exposure necessary for the declared export functionality. The CLI variant also interpolates `flags.export` without URL encoding. Although this does not directly permit changing the fixed origin, the quest identifier should still be encoded consistently. ### Attack Path 1. A merchant or an AI agent invokes the quest export command or the `export_submissions` MCP tool. 2. The handler reads the merchant API key from the environment or local configuration. 3. T ...[truncated 1260 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:27
Finding

Merchant API Key Stored Without Explicit Restrictive File Permissions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (25)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The export command embeds the API key directly in a URL query string. Query-string secrets are commonly leaked through browser history, logs, proxies, referer headers, screenshots, and shared links, making credential compromise much more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The MCP export tool returns a URL containing the API key, exposing the secret directly to the model, client logs, transcripts, and any downstream system that handles tool output. In MCP environments, tool results are often retained, making this substantially more dangerous than a local-only CLI printout.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The README instructs users to execute the package via npx without pinning a specific version, which causes clients to fetch and run whatever version is current at execution time. If the package is later compromised, typo-squatted, or a malicious update is published, users may unknowingly execute attacker-controlled code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README states that registration causes the API key to be auto-saved, but it gives no warning about where credentials are stored, under what permissions, or how users can inspect/remove them. In a CLI/MCP context, silent credential persistence can lead to accidental exposure through weak file permissions, shared environments, backups, or unexpected reuse by other tools.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This command example uses unpinned npx execution for account registration, which means users will run the latest published package version at the moment of invocation. Because registration likely handles sensitive business identity and API credential setup, a malicious package update could capture submitted data or alter local configuration.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The guide command is presented with an unpinned npx package reference, so users will execute an arbitrary future version rather than a reviewed one. While the command itself appears low-risk, it still grants execution to remote package contents and can be abused if the supply chain is compromised.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The draft command is invoked through unpinned npx, allowing remote code execution from whichever package version is current. In this merchant context, the tool may access prompts, business plans, or local environment data, making supply-chain compromise more consequential than a generic demo command.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The quest creation example uses an unpinned npx package, so users may execute a newly published and potentially malicious release. Because this workflow likely involves business content, account state, and payment-related actions, compromised execution could tamper with created tasks or exfiltrate merchant data.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The review command executes an unpinned package version, which exposes users to supply-chain risk every time they inspect quest results. If the package were compromised, it could manipulate displayed outputs, steal credentials, or perform unauthorized network/local actions under the user's permissions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding

This unpinned npx command is used for picking a winner, an action that appears business- and payment-relevant. If a malicious package version is served, it could alter winner selection, submit fraudulent actions, or misuse stored credentials, making the operational impact higher than for read-only commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill persists the API key in plaintext under the user's home directory without permission hardening or meaningful disclosure beyond a success note. Local plaintext storage increases the risk of credential theft from multi-user systems, backups, malware, or accidental file sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Operations such as early close, refund, and admin split can materially affect payouts and workflow state, yet they are invoked directly with no confirmation prompt or explicit warning at execution time. For code files, safety-critical operations should include some user disclosure unless clearly covered elsewhere, and these paths do not provide one.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The merchant-facing CLI exposes an admin-only settlement action via the --split path and documents it as part of normal merchant operations. In an agent/MCP context, surfacing privileged operations beyond the advertised role boundary increases the chance that a connected agent or user will invoke sensitive backend functionality they should never be encouraged to access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Deleting an offer is a destructive action, but the code immediately issues the DELETE request with no confirmation prompt, no warning print, and no explanatory comment. This lacks the user disclosure expected for destructive operations in a CLI/MCP tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The MCP tool list includes split_quest_equally even though the server is presented as a merchant server. Exposing privileged tools to LLM clients is especially risky because the model may discover and invoke them opportunistically, turning a backend authorization mistake into a practical privilege-escalation path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The MCP tool set_api_key silently stores a sensitive credential locally, which is risky in an agent setting because users may not realize a tool call causes persistent secret storage on disk. Hidden persistence of credentials can violate user expectations and increase exposure on shared or monitored systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

Tools such as pick_winner, pre_pick_winner, early_close_quest, refund_quest, split_quest_equally, complete_bounty, delete_offer, publish_quests, and deposit_credit can trigger consequential or irreversible state changes. These handlers execute directly with no confirmation, warning text, or inline disclosure about business impact.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The handler actively calls the admin settlement endpoint from a merchant MCP server, so the over-privileged capability is not merely documented but implemented. If backend controls are weak, this could enable unauthorized payout settlement; even with strong backend checks, it unnecessarily expands attack surface and invites misuse.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The skill instructs users to run an unpinned package via npx, which fetches and executes whatever version is current at invocation time. If the package is updated maliciously, compromised, or if a typo-squatted or hijacked release is published, users could execute attacker-controlled code in their local environment.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

This command uses npx without a fixed version, so the executed code is not stable or reviewable from the documentation alone. In a skill context, this is especially risky because users may copy-paste commands directly, causing them to run newly published code with full local user privileges.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The example encourages direct execution of an unversioned remote package for drafting tasks. Because npx resolves the latest package by default, a future compromised release could alter behavior, exfiltrate data, or perform arbitrary actions on the user's system.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The help command still requires executing the package first, so an unpinned npx invocation remains dangerous even if the user only intends to inspect usage. The lack of version pinning creates a supply-chain execution risk with low friction for exploitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README documents financially and operationally destructive actions such as picking winners, splitting rewards, refunding, deleting offers, banning agents, and triggering payouts, but it does not clearly warn about their monetary consequences or potential irreversibility. In this merchant/payment context, users may execute high-impact commands casually, leading to unintended fund movements, disputes, or business process abuse.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified with a caret range (^1.0.0), which allows installation of newer minor/patch releases that have not been explicitly reviewed. In a security-sensitive MCP server, this weakens supply-chain control and can unexpectedly pull in vulnerable or behavior-changing versions during install or deployment.

Content

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

json
},
  "homepage": "https://www.agenthansa.com/for-merchants",
  "dependencies": {
    "@modelcontextprotocol/sdk": "^1.0.0"
  },
  "files": ["index.js", "skill.md", "README.md", "package.json"]
}

Unverifiable Dependency: @modelcontextprotocol/sdk has 3 known advisory(ies) (CVE-2026-25536 (@modelcontextprotocol/sdk has cross-client data leak via shared server/transport); CVE-2026-0621 (Anthropic's MCP TypeScript SDK has a ReDoS vulnerability); CVE-2025-66414 (Model Context Protocol (MCP) TypeScript SDK does not enable DNS rebinding protec)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The manifest references a dependency with known advisories, but because the version is not pinned it is impossible to determine from this file whether the installed release is affected. Given this package provides an MCP server that may handle cross-client data, network traffic, and untrusted input, unresolved SDK flaws such as data leakage, ReDoS, or missing DNS rebinding protections can have real security impact in this context.

Content

No source excerpt is available for this finding.