Back to skill

Security audit

腾讯地图地址·零售渠道与竞对分析

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed retail-analysis API helper with no hidden code, installation hooks, persistence, or unrelated access.

Install only if you trust the DDT service and will provide an appropriate DDT_API_KEY. Before use, make sure DDT_OPEN_BASE is unset or pinned to the documented HTTPS endpoint so the bearer token is not sent to an unexpected host.

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

Warning
Location
SKILL.md:33
Finding

Environment-Controlled API Base URL Can Expose the Bearer Token

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 33–37 and 72–86
Vulnerability Type: Unvalidated destination for authenticated API requests
Risk Level: Medium

Vulnerable Code

bash
export DDT_API_KEY="ddt_live_xxxxxxxx"
export DDT_OPEN_BASE="${DDT_OPEN_BASE:-https://gotoshop-ai.com/ddtclaw}"

The configurable value is subsequently used in authenticated requests:

bash
curl --fail --silent --show-error -G \
  -H "Authorization: Bearer $DDT_API_KEY" \
  "$DDT_OPEN_BASE/v1/retail/brand/profile" \
  --data-urlencode "brand=美宜佳"

curl --fail --silent --show-error -G \
  -H "Authorization: Bearer $DDT_API_KEY" \
  "$DDT_OPEN_BASE/v1/retail/brand/categories" \
  --data-urlencode "brand=美宜佳"

curl --fail --silent --show-error -G \
  -H "Authorization: Bearer $DDT_API_KEY" \
  "$DDT_OPEN_BASE/v1/retail/nearby" \
  --data-urlencode "lng=121.5" \
  --data-urlencode "lat=31.2" \
  --data-urlencode "radius=3000"

Technical Analysis

The shell parameter expansion preserves any preexisting DDT_OPEN_BASE value without validating its scheme, hostname, port, or path. The documented curl commands then attach the API bearer token to requests sent to that destination.

If an attacker can influence the execution environment, such as through a poisoned shell profile, CI/CD variable, wrapper process, or inherited environment configuration, the attacker can redirect authenticated requests to a server under their control. This violates the principle that credentials should only be transmitted to explicitly trusted and authenticated origins.

Although the examples use HTTPS by default, the configuration accepts arbitrary destinations, potentially including an attacker-controlled HTTPS endpoint or a plaintext HTTP endpoint.

Attack Path

  1. The attacker gains the ability to define or modify an inherited environment variable.
  2. The attacker sets DDT_OPEN_BASE to an attacker-controlled URL.
  3. A user or agent executes the initialization ...[truncated 922 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin authenticated requests to the documented origin rather than inheriting an unrestricted environment value:
bash
readonly DDT_OPEN_BASE="https://gotoshop-ai.com/ddtclaw"
  1. If endpoint configurability is required, validate it before sending credentials. Enforce:

    • The https scheme.
    • An explicit hostname allowlist.
    • An expected port.
    • No embedded user information.
    • An approved base path.
  2. Refuse the request when validation fails, and never attach the Authorization header to an untrusted origin.

  3. Separate production and development credentials. If local or staging endpoints must be supported, use distinct limited-scope keys for each approved environment.

  4. Apply least privilege, expiration, rotation, and usage monitoring to API keys. Revoke and rotate any key suspected of exposure.

  5. Document that proxies, redirects, and inherited environment variables must not move authorization headers outside the approved service origin. Configure the HTTP client to reject unsafe cross-origin redirects.

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