Back to skill

Security audit

旅游意外险

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its insurance workflow purpose, but it asks agents to store sensitive tokens and identity data in a plaintext workspace file.

Review this skill carefully before installing. Use it only in a private workspace, avoid committing or sharing `.agent-state.json`, and clear that file when finished. Be aware it can handle purchases, payment links, invoices, policy downloads, surrender, and refunds through a production insurance API.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:75
Finding

Plaintext Persistence of Bearer Tokens and Identity Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 75–130 and 303–305
Vulnerability Type: Plaintext storage of authentication credentials and personally identifiable information
Risk Level: High

Vulnerable Code Snippet

markdown
### Local state management (.agent-state.json)

The Agent persists the token and commonly used personnel information through
the `.agent-state.json` file in the workspace root.

#### At the beginning of a conversation

1. Execute `date "+%Y-%m-%d %H:%M:%S %Z"` to obtain the current local time.
2. Read `.agent-state.json`.
3. If `token` exists and `expires` is later than the current timestamp, use
   that token directly and skip login.
4. If `policyholder` or `frequentInsured` contains data, prioritize it when
   placing subsequent orders.

#### After successful login

Write the login response to `.agent-state.json`, preserving the existing
`policyholder` and `frequentInsured` values. It is also recommended to save
`mobile`.

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expires": 1735689600,
  "userId": 1001,
  "mobile": "13800138000",
  "policyholder": {
    "holderType": "individual",
    "fullName": "Zhang San",
    "idNumber": "310101199001011234",
    "mobileNumber": "13800138000"
  },
  "frequentInsured": [
    { "fullName": "Zhang San", "idNumber": "310101199001011234" },
    { "fullName": "Li Si", "idNumber": "310101199101011234" }
  ],
  "schemaVersion": "2026.3",
  "schemaCache": {}
}

After an order is successfully created, write the policyholder and frequently
insured persons to `.agent-state.json`, deduplicating by `idNumber`.

The snippet above is an English rendering of the operative instructions and data structure in the cited source lines.

Technical Analysis

The Skill explicitly instructs the Agent to persist bearer tokens, mobile numbers, names, and government-issued identification numbers in a predictable plaintext file at the workspace root. A bearer token is a reusable credential: a ...[truncated 3006 chars]

Remediation
View remediation

Remediation Suggestions

  1. Move bearer tokens to protected credential storage

    • Use the operating system keychain, a host-provided secret manager, or an Agent runtime credential vault.
    • Store only an opaque credential reference in workspace state.
    • Never place bearer tokens in project files or other routinely shared locations.
  2. Stop retaining full identity records by default

    • Require explicit, informed opt-in before saving frequently used persons.
    • Retain only fields strictly necessary for the declared convenience feature.
    • Prefer masked identifiers or a server-side record reference instead of complete ID numbers.
    • Do not persist data for unrelated insured persons without appropriate authorization.
  3. Protect any unavoidable local state

    • Store it outside the project tree in a per-user application-data directory.
    • Apply owner-only permissions, such as mode 0600 on POSIX systems.
    • Use authenticated encryption with keys held outside the state file.
    • Use atomic writes and reject symbolic links to avoid unsafe file replacement.
  4. Prevent accidental propagation

    • Add .agent-state.json to .gitignore and equivalent backup, archive, support-bundle, and telemetry exclusions.
    • Add repository scanning or pre-commit checks that block state files, bearer tokens, mobile numbers, and government ID patterns.
    • Ensure logs and error messages redact authorization headers and identity fields.
  5. Implement lifecycle controls

    • Delete credentials immediately on logout, revocation, or expiration rather than merely checking the timestamp.
    • Define short retention periods for saved customer records.
    • Provide users with review, deletion, and “do not remember” controls.
    • Rotate or revoke a token when unintended disclosure is suspected.
  6. Reduce transactional risk

    • Require fresh user confirmation for purchases, surrender, refund, invoice issuance, and irreversible invoice reversal. ...[truncated 186 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (17)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs persistent storage of authentication tokens, mobile numbers, ID numbers, policyholder details, and frequent insured persons in .agent-state.json. Storing sensitive identity and auth data locally without explicit consent, minimization, encryption, retention limits, or access controls creates a substantial privacy and account-compromise risk if the workspace is exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly states that the agent will persist login state and common personal information in .agent-state.json, but it does not clearly warn users about the sensitivity of that data, retention expectations, local access risks, or how it should be protected. In the context of an insurance workflow handling identity and policy data, this can lead to unintended exposure of personal information if the workspace is shared, backed up insecurely, or accessed by other tools or users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill description and operational content are presented in Chinese and oriented to a China-specific insurance workflow, but the file does not explicitly state that the skill is restricted to Chinese-language use or offer an opt-in language choice. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless clearly documented and justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list contains short, generic transactional terms like '报价', '下单', '支付', '开票', and '退款' that are common across many unrelated domains. This can cause unintended activation of a high-privilege insurance skill in the wrong context, increasing the chance of unnecessary collection of personal data or accidental execution of insurance-related workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill directs the agent to download insurance policy PDFs and confirmation documents to local filenames without warning the user that files will be created on disk. These files likely contain sensitive personal and insurance information, so silent local persistence can expose private data to other local users, backups, or later processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The metadata describes collection and server-side derivation of highly sensitive personal identity data, including Chinese ID numbers, for insurance ordering, but does not warn users or downstream agents about the sensitivity, handling expectations, or privacy/security implications. In an agent-driven workflow, this omission increases the chance that identity data will be solicited, transmitted, logged, or reused without adequate user awareness or consent, which can lead to privacy violations and regulatory exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The README foregrounds a Chinese-specific skill and the content is primarily in Chinese, while also describing support for Chinese ID cards. Although an English section exists, the document does not explicitly offer user opt-in or choice regarding language/locale behavior, which may conflict with language neutrality expectations.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
86% confidence
Finding

The trigger '报价' is too generic and can match many non-insurance conversations involving quotes or pricing. In this skill, accidental activation is more concerning because the workflow can lead into login, PII collection, and insurance transaction handling.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
87% confidence
Finding

The trigger '投保' is short and ambiguous outside this specific insurance flow. Unintended activation could route unrelated insurance or transactional requests into this skill and prompt collection of sensitive personal details unnecessarily.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
90% confidence
Finding

The trigger '下单' is a universal e-commerce phrase with very low specificity. Because this skill handles regulated insurance purchases and identity data, accidental activation from generic shopping contexts is a real safety issue.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
91% confidence
Finding

The trigger '支付' is extremely broad and likely to appear in many unrelated workflows. In a skill that can generate payment URLs and move users into financial transactions, accidental invocation can misroute users and expose payment-related information unnecessarily.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
88% confidence
Finding

The trigger '开票' is generic across many industries and services. Here it may wrongly activate a skill that handles insurance-policy-linked invoicing and potentially sensitive order data.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
88% confidence
Finding

The trigger '发票' is too broad for a specialized insurance skill. Unintended activation may result in exposing invoice-related workflows or requesting policy details from users in unrelated billing contexts.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
80% confidence
Finding

The trigger '红冲' is short and can apply to general invoicing or finance operations outside this skill. Although narrower than '支付' or '下单', it is still insufficiently scoped for a skill performing insurance invoice reversals.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
87% confidence
Finding

The trigger '退保' is short and may activate on unrelated insurance discussions not tied to this provider or product type. Given that cancellation flows can affect active policies and refunds, overly broad matching is risky.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
84% confidence
Finding

The trigger '退费' is generic and commonly used in many service contexts. In this skill, accidental activation could route users into insurance refund workflows that involve order identifiers and potentially sensitive account data.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
89% confidence
Finding

The trigger '退款' is a very common commerce term and is not specific to travel insurance. Because the skill can handle financial after-sales actions, this broad trigger increases the chance of misrouting unrelated refund requests into a regulated insurance flow.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.