Back to skill

Security audit

ASG Card

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent payment-card integration, but it gives an agent broad autonomous spending and card-detail access with several artifact-backed security weaknesses users should review carefully.

Install only if you are comfortable giving an agent autonomous payment-card authority. Use a low-balance dedicated Stellar wallet, avoid command-line or config-file exposure of wallet secrets where possible, do not let agents log or forward PAN/CVV data, set strict spending and tool-use approvals in your client, and prefer a pinned, reviewed package version rather than unversioned npx onboarding.

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

T09 · Insecure Skill Coding Practices

Error
Location
api/src/middleware/walletAuth.ts:43
Finding

Wallet authentication signatures are replayable across endpoints and actions

Content
View full analysis
{ const address = req.header("X-WALLET-ADDRESS"); const signatureEncoded = req.header("X-WALLET-SIGNATURE"); const timestampHeader = req.header("X-WALLET-TIMESTAMP"); if (!address || !signatureEncoded || !timestampHeader) { res.status(401).json({ error: "Missing wallet authentication headers" }); return; } const timestamp = Number(timestampHeader); if (!Number.isFinite(timestamp)) { res.status(401).json({ error: "Invalid wallet timestamp" }); return; } const now = Math.floor(Date.now() / 1000); if (Math.abs(now - timestamp) > MAX_CLOCK_DRIFT_SECONDS) { res.status(401).json({ error: "Wallet timestamp outside accepted window" }); return; } try { if (!StrKey.isValidEd25519PublicKey(address)) { res.status(401).json({ error: "Invalid Stellar public key" }); return; } const pubkeyBytes = StrKey.decodeEd25519PublicKey(address); const signature = decodeSignature(signatureEncoded); const message = new TextEncoder().encode(`asgcard-auth:${timestamp}`); const verified = nacl.sign.detached.verify(message, signature, pubkeyBytes); if (!verified) { res.status(401).json({ error: "Invalid wallet signature" }); return; } req.walletContext = { address, timestamp }; trackApiActivity(address).catch(() => {}); next(); } catch { res.status(401).json({ error: "Invalid wallet authentication payload" }); } }; ``` The client generates the same request-independent signature: ```ts private signAuth(): { address: string; signature: string; timesta ...[truncated 3199 chars]
Remediation
View remediation
method: path: body-sha256: timestamp: nonce: ``` Required hardening measures: 1. Include the HTTP method, canonical path, query string, and body digest in every signature. 2. Include the agent nonce in the signed message for card-details requests. 3. Prefer a server-issued, single-use challenge stored with a short expiration. 4. Atomically consume each challenge or nonce and reject reuse across all endpoints. 5. Reduce the accepted clock window after deploying nonce enforcement. 6. Include an audience or origin identifier to prevent signatures from being replayed against another deployment. 7. Apply the same signing implementation to the CLI, MCP server, SDK examples, and browser portal. 8. Add automated tests proving that: - A signature for `GET /cards/` fails on `POST /cards/{id}/freeze`. - A signature for one card ID fails for another card ID. - A changed body or query string invalidates the signature. - A reused nonce is rejected atomically. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
sdk/src/utils/x402.ts:35
Finding

x402 client signs server-controlled arbitrary token transfer parameters

Content
View full analysis
{ if (!input || typeof input !== "object") return false; const r = input as Record; return r.x402Version === 2 && Array.isArray(r.accepts); }; export const parseChallenge = (input: unknown): X402Accept => { if (!isChallenge(input) || input.accepts.length === 0) { throw new PaymentError("Invalid x402 challenge payload"); } return input.accepts[0]; }; ``` The returned values are used directly to build the authorized transfer: ```ts const tx = await contract.AssembledTransaction.build({ contractId: params.accept.asset, method: "transfer", args: [ nativeToScVal(params.publicKey, { type: "address" }), nativeToScVal(params.accept.payTo, { type: "address" }), nativeToScVal(BigInt(params.accept.amount), { type: "i128" }), ], networkPassphrase, rpcUrl: RPC_URL, parseResultXdr: (result: any) => result, }); ``` The same issue exists in the wallet-adapter path: ```ts const c = new Contract(params.accept.asset); const sourceAccount = await params.rpcServer.getAccount(publicKey); const tx = new TransactionBuilder(sourceAccount, { fee: DEFAULT_FEE, networkPassphrase: Networks.PUBLIC, }) .addOperation( c.call( "transfer", new Address(publicKey).toScVal(), new Address(params.accept.payTo).toScVal(), nativeToScVal(BigInt(params.accept.amount), { type: "i128" }) ) ) .setTimeout(SOROBAN_TIMEOUT) .build(); ``` ### Technical Analysis The challenge parser checks only that the response has x402 version 2 and a non-empty `accepts` array. It does not validate that the chosen acceptance entry has t ...[truncated 2109 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
cli/src/index.ts:105
Finding

CLI accepts wallet secrets through command-line arguments and persists them in plaintext

Content
View full analysis
", "Custom API URL") .option("--rpc-url ", "Custom Stellar RPC URL") .action(async (key?: string, options?: { apiUrl?: string; rpcUrl?: string }) => { let privateKey = key; if (!privateKey) { const readline = await import("node:readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); privateKey = await new Promise((resolve) => { rl.question(chalk.cyan("Enter Stellar secret key (S...): "), (answer) => { rl.close(); resolve(answer.trim()); }); }); } if (!privateKey?.startsWith("S")) { console.error(chalk.red("❌ Invalid key. Must start with S (Stellar secret key).")); process.exit(1); } const config: Config = { ...loadConfig(), privateKey, ...(options?.apiUrl && { apiUrl: options.apiUrl }), ...(options?.rpcUrl && { rpcUrl: options.rpcUrl }), }; saveConfig(config); ``` ### Technical Analysis Passing the private key as `asgcard login S...` can expose ...[truncated 1777 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:31
Finding

Unversioned npx onboarding executes a mutable remote package

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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 (194)

Known Vulnerable Dependency: vitest==4.0.18 — 2 advisory(ies): CVE-2026-47429 (When Vitest UI server is listening, arbitrary file can be read and executed); CVE-2026-84373 (Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock)

Critical
Category
Supply Chain
Confidence
91% confidence
Finding

The project includes vitest 4.0.18, which the finding identifies as affected by critical advisories involving arbitrary file read and potential code execution/path traversal in Vitest UI and mocker functionality. Even though Vitest is a dev dependency, development and CI environments often handle repository secrets, source code, and tokens, so exploitation could expose sensitive data or enable code execution in trusted environments. In a payment-card and crypto-related skill, leakage of wallet material, API credentials, or internal test fixtures would be especially damaging.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The manifest explicitly advertises get_card_details returning PAN, CVV, and expiry, yet it does not provide strong user-facing warnings about handling PCI-sensitive data, storage prohibitions, or access constraints. In an agent setting, exposing full card details to automated tooling materially increases the risk of credential leakage, logging, replay into other tools, or unauthorized spending if downstream components are compromised.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access, suspicious.exposed_secret_literal, suspicious.insecure_tls_verification

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
api/__tests__/webhook-and-verify.test.ts:8

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
api/src/services/fourPaymentsClient.ts:307

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
cli/src/index.ts:60

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
cli/src/index.ts:373

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
mcp-server/src/server.ts:36

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
api/src/db/db.ts:33