Back to skill

Security audit

百家姓查询 - 即刻数据

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a straightforward surname lookup tool, but it has an undocumented endpoint override that can redirect the API key to an arbitrary host.

Review before installing. Use this only if you trust the publisher and runtime environment, and avoid setting JIKE_API_BASE_URL. Prefer a version that fixes the API host to https://api.jikeapi.cn or validates the host before attaching the AppKey.

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/surname_query.py:21
Finding

Undocumented API Endpoint Override Can Disclose the AppKey

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (7)

Tainted flow: 'url' from os.environ.get (line 139, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The request target is built from JIKE_API_BASE_URL, which is taken directly from an environment variable, so whoever controls the runtime environment can redirect requests to an arbitrary host. Because the URL also includes the appkey query parameter, this can exfiltrate the credential to an attacker-controlled server and cause SSRF-like outbound requests from the host running the skill.

Content

Scanner excerpt · scripts/surname_query.py (reported line 141)May include surrounding context.

python
"""
    url = f"{API_BASE_URL}{API_PATH}?{urllib.parse.urlencode({**params, 'appkey': appkey})}"
    try:
        with urllib.request.urlopen(url, timeout=15) as response:
            return json.loads(response.read().decode("utf-8"))
    except urllib.error.HTTPError as exc:
        return {"code": exc.code, "message": f"接口请求失败: HTTP {exc.code}", "data": ""}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/surname_query.py (reported line 54)May include surrounding context.

python
env_value = os.environ.get(env_name, "").strip()
        if env_value:
            return env_value
    env_file = Path(__file__).parent / ".env"
    if not env_file.exists():
        return ""
    for line in env_file.read_text(encoding="utf-8").splitlines():

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill instructs the agent to run a local Python script that uses environment secrets and performs outbound network access, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and can allow broader-than-expected access to environment variables, local files, or network resources when the skill is executed.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
"title": "百家姓查询 - 即刻数据",
  "description": "百家姓查询。输入姓氏,查询姓氏起源、名人、迁徙分布等信息。",
  "env": "JIKE_SURNAME_QUERY_KEY",
  "api_url": "https://api.jikeapi.cn/v1/surname/query",
  "homepage": "https://www.jikeapi.cn/"
}

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · _meta.json (reported line 8)May include surrounding context.

json
"title": "百家姓查询 - 即刻数据",
  "description": "百家姓查询。输入姓氏,查询姓氏起源、名人、迁徙分布等信息。",
  "env": "JIKE_SURNAME_QUERY_KEY",
  "api_url": "https://api.jikeapi.cn/v1/surname/query",
  "homepage": "https://www.jikeapi.cn/"
}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The AppKey is appended to the URL query string, which can be exposed through logs, proxies, browser/history equivalents, monitoring systems, or error messages. In this skill, that risk is amplified because the base URL is configurable, so a redirected request would leak the credential directly to another endpoint.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/surname_query.py (reported line 121)May include surrounding context.

python
"""
    params = {}
    for param_name, _ in REQUIRED_PARAMS + OPTIONAL_PARAMS:
        value = getattr(args, param_name, "")
        value = validate_date_param(param_name, str(value))
        if value:
            params[param_name] = value