Back to skill

Security audit

Советы для поездки в Китай

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its China travel purpose, but it embeds a reusable proxy credential and includes an unrelated publishing script, so it needs Review before installation.

Install only if you are comfortable with travel queries being sent to the publisher's proxy and TripGenie. The publisher should rotate the exposed proxy token, remove hardcoded credentials, use the declared environment variables, and remove or clearly separate the publishing helper script before normal users rely on it.

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
scripts/china_travel.py:22
Finding

Hardcoded Proxy Authentication Token

Content
View full analysis

Vulnerability Details

File Location: scripts/china_travel.py, lines 22–23 and 31–36
Vulnerability Type: Hardcoded reusable authentication credential
Risk Level: High

Vulnerable Code

python
PROXY_URL = "https://1439498936-eu423jdjnd.ap-guangzhou.tencentscf.com"
PROXY_TOKEN = "tp_8k2mX9vQ4z"
python
req = urllib.request.Request(
    PROXY_URL, data=data,
    headers={
        "Content-Type": "application/json",
        "X-Proxy-Token": PROXY_TOKEN,
        "User-Agent": "ChinaTravel/2.0",
    },
    method="POST"
)

Technical Analysis

The source code embeds a reusable proxy authentication token and its associated endpoint. Anyone who can obtain the distributed skill package can extract the credential without executing the program.

The implementation also contradicts the environment-variable declarations in SKILL.md: rather than loading PROXY_URL and PROXY_TOKEN from the runtime environment, it uses fixed constants. Consequently, deployment-level secret management cannot protect or rotate this credential independently of the package.

An attacker can reproduce the request structure shown in the code and submit authenticated requests directly to the proxy. Whether access to downstream services is possible depends on server-side controls not present in the audited project, but the exposed token is sufficient to attempt unauthorized use of the proxy identity.

Attack Path

  1. Obtain or download the published skill package.
  2. Inspect scripts/china_travel.py.
  3. Extract the fixed proxy URL and the value assigned to PROXY_TOKEN.
  4. Construct an HTTPS POST request containing a JSON body with query, locale, and command_type.
  5. Set the extracted token in the X-Proxy-Token header.
  6. Send requests directly to the proxy outside the intended skill workflow.
  7. Continue using the credential until it is rotated, revoked, or blocked by server-side con ...[truncated 715 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke and rotate the exposed token. Treat it as compromised because it was committed to distributable source code.

  2. Remove the token and deployment-specific endpoint from source control.

  3. Load configuration from the declared environment variables and fail closed when they are missing:

    python
    import os
    
    PROXY_URL = os.environ.get("PROXY_URL")
    PROXY_TOKEN = os.environ.get("PROXY_TOKEN")
    
    if not PROXY_URL or not PROXY_TOKEN:
        raise RuntimeError("Required proxy configuration is missing")
    
  4. Provision secrets through an approved secret manager or protected runtime configuration rather than package metadata, command-line arguments, or plaintext files.

  5. Prefer short-lived, narrowly scoped credentials. Restrict the token to only the required proxy operations and downstream resources.

  6. Enforce server-side rate limits, request quotas, expiration, revocation, origin or workload identity checks, and abuse monitoring. A client-side secret distributed to users must not be considered confidential.

  7. Review proxy access logs for unauthorized use of the exposed token and invalidate any related credentials if suspicious activity is found.

  8. Add secret scanning to source-control and publication pipelines to prevent future releases containing tokens or API keys.

  9. If the client is intentionally public, replace the shared static secret with an authentication design that does not rely on keeping credentials confidential in distributed code.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is for an end-user travel assistance skill, but the supplied code does not implement any travel-guide functionality. Instead, it performs a deployment/publishing action for a Russian-language version of a skill by calling another publish script with release parameters. This is a materially different primary purpose and an undeclared operational capability, so it is a clear mismatch.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares only a local shell tool but its documented behavior clearly relies on outbound network access via a proxy and external API. Missing explicit tool/network scoping weakens least-privilege controls and can allow broader-than-expected external communication, making review, enforcement, and containment harder if the script is modified or abused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instructions require always passing --locale=ru and state that results and presented content must be in Russian. This enforces a specific language regardless of user preference, which matches the policy category for language/locale constraints without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The natural-language comment '发布俄文版最后一个技能' describes a Russian-language publication target, which suggests a fixed locale/language constraint. The file does not offer any user opt-in or explain a region-specific compliance reason for forcing that language choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User travel queries are sent to a third-party proxy service, and those queries may contain sensitive personal or itinerary data such as destinations, dates, budgets, and preferences. Without any disclosure, consent, or minimization, users may unknowingly expose personal travel information to an external operator, creating privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Ssd 2

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Several query builders embed user-controlled fields such as preferences and interests directly into natural-language prompts sent to a remote model. In this skill context, attackers can hide instruction text inside seemingly legitimate travel parameters, potentially steering backend model behavior away from intended travel assistance and into policy-evasive or misleading output generation.

Content

No source excerpt is available for this finding.

Ssd 2

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The tips mode forwards arbitrary user text directly to the backend model with no filtering, policy enforcement, or structural constraints. In an agent skill context, this increases the chance that hostile prompt text can manipulate the remote model into producing unsafe, policy-bypassing, or off-scope outputs, especially because the feature is explicitly open-ended.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The docstring describes a specific behavior of the request path: 'affiliate links auto-injected.' In the code shown, the function simply posts the query, locale, and command_type to a remote proxy with a token header; no affiliate-link handling exists client-side, and the code does not verify that the server performed that action. This is an intent/documentation mismatch rather than a functional bug.

Content

No source excerpt is available for this finding.