Back to skill

Security audit

Card Management

Security checks for vulnerabilities and agentic risk

Overview

This card-management skill has a legitimate purpose but needs review because it handles highly sensitive payment actions and exposes card ATM PINs too broadly.

Review this before installing in any real payment environment. Use only a trusted HTTPS API base URL, keep bearer tokens and all PINs out of logs, and consider requiring explicit user confirmation and step-up verification before revealing any ATM PIN or performing irreversible actions such as cancellation.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Error
Location
SKILL.md:15
Finding

Environment-Controlled API Base URL May Expose Financial Credentials over Untrusted or Plaintext Connections

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 15-24; related credential-handling instructions at lines 77-78
Vulnerability Type: Arbitrary endpoint redirection and insecure transport of sensitive data
Risk Level: High

Vulnerable Code Snippet:

markdown
## Configuration

The default API base URL is `https://payment-api-dev.aiotnetwork.io`. All endpoints are relative to this URL.

To override (e.g. for local development):

```bash
export AIOT_API_BASE_URL="http://localhost:8080"

If AIOT_API_BASE_URL is not set, use https://payment-api-dev.aiotnetwork.io as the base for all requests.

text

Related instructions demonstrate that requests can contain bearer credentials and transaction PINs:

```markdown
- If a tool requires authentication, verify the session has a valid bearer token before calling it.
- If a tool requires a transaction PIN, ask the user for it fresh each time. Never cache or log PINs.

Technical Analysis

The skill allows AIOT_API_BASE_URL to determine the destination for all financial API requests, but it does not require HTTPS, validate the destination against a trusted-host allowlist, or define controls for cross-origin redirects. The documented configuration explicitly permits an HTTP URL.

Because the endpoints require bearer authentication and some operations require a transaction PIN, an attacker who can influence the environment variable could redirect sensitive requests to an attacker-controlled server. Even when the configured host is legitimate, plaintext HTTP permits network interception and modification unless its use is strictly restricted to a protected loopback environment.

The instruction not to cache or log PINs reduces persistence risk but does not prevent a PIN from being transmitted to an untrusted endpoint at request time.

Attack Path

  1. An attacker compromises deployment configuration, a startup environment, or another mechan ...[truncated 1501 chars]
Remediation
View remediation

Remediation Suggestions

  • Require HTTPS for every non-loopback API destination.
  • Restrict the API host to an explicit allowlist of trusted production and development origins.
  • If local HTTP development is necessary, permit it only for exact loopback addresses such as 127.0.0.1 or localhost, and clearly prohibit its use in deployed environments.
  • Parse and validate the configured URL before issuing requests. Reject embedded credentials, unexpected ports, ambiguous hostnames, non-HTTP schemes, and malformed URLs.
  • Disable redirects for requests carrying authorization credentials or sensitive financial data. Alternatively, require every redirect target to preserve the exact trusted origin.
  • Never forward bearer tokens, transaction PINs, PANs, CVVs, or identity information after an origin change.
  • Separate development and production configurations so that an insecure development setting cannot silently become active in production.
  • Apply certificate validation and fail closed on TLS errors.
  • Minimize token scope and lifetime so that exposure of a bearer token has reduced impact.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:31
Finding

ATM PINs Are Returned by Broad Card Listing and Lookup Operations Without Step-Up Verification

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 31-35; corroborating instructions at lines 62-63 and 84-88
Vulnerability Type: Excessive disclosure of card authentication secrets
Risk Level: High

Vulnerable Code Snippet:

markdown
- `create_multi_use_card` — Create a multi-use virtual card for repeated purchases | `POST /api/v1/masterpay/cards/multi-use` | Requires auth
- `list_cards` — List all cards in a wallet (defaults to first wallet) | `GET /api/v1/masterpay/wallets/cards` | Requires auth
- `list_cards_by_wallet` — List cards for a specific wallet UUID | `GET /api/v1/masterpay/wallets/:wallet_uuid/cards` | Requires auth
- `get_card` — Get details of a specific card by UUID (includes card ATM PIN, no transaction PIN required) | `GET /api/v1/masterpay/cards/:id` | Requires auth
- `get_card_details` — Get full unmasked card number, CVV, and expiry (sensitive) | `POST /api/v1/masterpay/cards/:id/details` | Requires auth | Requires transaction PIN

The behavior is explicitly reinforced elsewhere:

markdown
- MasterPay card responses include a masked PAN and the card ATM PIN — use /cards/:id/details with transaction PIN for the full card number and CVV
- The card ATM PIN (visible in get_card, list_cards, and card creation responses) is for ATM/POS use — it is different from the transaction PIN used for sensitive operations
markdown
- MasterPay card responses (creation, `get_card`, `list_cards`) include the card ATM PIN in the response — no transaction PIN is needed to see it.
- To get the full unmasked card number and CVV, call `get_card_details` with the user's transaction PIN. This is the only way to retrieve the full PAN and CVV.
- The card ATM PIN (for ATM/POS use) is different from the transaction PIN (the user's security PIN for sensitive operations like viewing full card details, locking, unlocking, or cancelling).

Technical Analysis

The documented API des ...[truncated 2283 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove ATM PINs from card creation, card listing, and ordinary card-detail responses.
  • Ensure collection endpoints return only non-sensitive metadata necessary to identify and manage cards.
  • Provide a dedicated PIN reveal or reset operation instead of embedding the PIN in general responses.
  • Require step-up authentication for any PIN reveal, such as a fresh transaction PIN plus additional server-side risk checks.
  • Require explicit user confirmation immediately before revealing a PIN.
  • Return the PIN only for the specifically selected card and never in a multi-card response.
  • Apply strict field-level redaction in API gateways, tool adapters, logs, traces, analytics systems, and agent transcripts.
  • Prevent caching or persistence of PIN-bearing responses and minimize their lifetime in memory.
  • Record security audit events for PIN reveal attempts without recording the PIN itself.
  • Rate-limit reveal operations and notify the account holder of sensitive credential access.
  • Prefer secure PIN reset workflows over recovery of an existing PIN where supported by the card platform.
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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep