Back to skill

Security audit

tjweather天气查询助手

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but users should be aware that weather/location requests and the API key are sent to external services and the documentation includes weak credential-handling examples.

Install only if you are comfortable sending location queries to external geocoding services and coordinates plus your TJWeather API key to TJWeather. Use your own key through SecretRef or an environment variable, avoid plaintext config where possible, and do not rely on the shared trial keys shown in the README.

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

T09 · Insecure Skill Coding Practices

Warning
Location
README.md:10
Finding

Publicly Exposed TJWeather API Credentials

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
README.md:37
Finding

Documentation Encourages Persistent Plaintext API Key Storage

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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/tjweather.py (reported line 42)May include surrounding context.

python
try:
        req = urllib.request.Request(url)
        with urllib.request.urlopen(req, timeout=15) as response:
            data = json.loads(response.read().decode('utf-8'))
            
        code = str(data.get('code', '200'))

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/tjweather.py (reported line 15)May include surrounding context.

python
"""调用 TJWeather API 获取天气数据"""
    api_key = os.environ.get('TJWEATHER_API_KEY')
    
    # 兜底:如果环境变量未注入,尝试从同级目录的 .env 文件加载
    if not api_key:
        env_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '.env')
        try:

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/tjweather.py (reported line 29)May include surrounding context.

python
"""调用 TJWeather API 获取天气数据"""
    api_key = os.environ.get('TJWEATHER_API_KEY')
    
    # 兜底:如果环境变量未注入,尝试从同级目录的 .env 文件加载
    if not api_key:
        env_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '.env')
        try:

Credential Access

High
Category
Privilege Escalation
Confidence
77% confidence
Finding

The script reads a plaintext .env file from a relative parent directory to obtain the API key. In shared or multi-tenant environments, this increases the risk of accidental secret exposure, insecure file permissions, or unintentional use of credentials from an unexpected file location.

Content

Scanner excerpt · scripts/tjweather.py (reported line 17)May include surrounding context.

python
# 兜底:如果环境变量未注入,尝试从同级目录的 .env 文件加载
    if not api_key:
        env_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '.env')
        try:
            with open(env_file, 'r') as f:
                for line in f:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation says the skill's primary output language is Chinese, which imposes a language preference by default. Although it mentions dynamic adaptation of data labels, it does not clearly offer the user a language choice or require opt-in for Chinese as the default output language.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes local Python scripts, relies on an environment variable API key, and contacts external geocoding/weather services, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates a governance gap: the runtime may grant broader-than-expected file, env, or network access, making it harder for users and platform controls to constrain what the skill can do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill processes user-supplied location queries and sends them to external weather/geocoding services, but the description does not clearly warn users that their location data will leave the local environment. Because location queries can contain sensitive or identifying information such as home, workplace, or frequently visited places, this omission undermines informed consent and can expose private data to third parties.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file consistently uses Chinese-only natural language in comments, stderr logs, and end-user error/help messages, indicating the skill is effectively constrained to a single language/locale. The file does not offer a language choice or explain a justified region-specific requirement, which matches the language/locale policy-violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This Python skill contains natural-language docstrings, errors, usage text, and formatted output entirely in Chinese, including the main user-visible response strings. Because the file does not offer an opt-in language choice or clearly justify a China-specific locale constraint, it may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

The skill transmits user-supplied location data and an API credential to an external third-party service. In this context that is expected functionality, but it still creates a real data exposure boundary: coordinates, query context, and the API key leave the local environment and could be logged by the remote service or by local proxies if mishandled.

Content

Scanner excerpt · scripts/tjweather.py (reported line 38)May include surrounding context.

python
lon_val = float(lon)
    if lon_val < 0:
        lon_val = lon_val + 360
    url = f"https://api.tjweather.com/beta?loc={lon_val},{lat}&key={api_key}&fields={fields}&fcst_days={fcst_days}&tz={tz}"
    
    try:
        req = urllib.request.Request(url)