T09 · Insecure Skill Coding Practices
- Location
scripts/zodiac_sign_query.py:23- Finding
Unvalidated API endpoint override can disclose the AppKey
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill performs the advertised zodiac lookup, but an undocumented endpoint override can redirect the user's API key to another server.
Review before installing. Use this only with a Jike API key you are comfortable sending to Jike, avoid setting JIKE_API_BASE_URL, and prefer a version that pins or validates the API host and avoids putting the AppKey in the URL query string.
scripts/zodiac_sign_query.py:23Unvalidated API endpoint override can disclose the AppKey
The request target is derived from the JIKE_API_BASE_URL environment variable and then used in urllib.request.urlopen(), allowing the runtime environment to redirect requests to an arbitrary host. In a skill context, this can expose the AppKey in the query string to unintended endpoints and enable SSRF-like outbound access if an attacker can influence environment configuration.
"""
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": ""}
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
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():
The skill invokes a Python script that uses environment variables, reads local files, and makes outbound network requests, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization gap where an agent may run the skill with broader capabilities than reviewers or policy systems expect, increasing the risk of unintended data access or exfiltration.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"title": "星座查询 - 即刻数据",
"description": "星座查询。输入星座名称,查询星座特征、守护宫、阴阳性、守护星、幸运色、幸运数字、区间和男女特点。",
"env": "JIKE_ZODIAC_SIGN_QUERY_KEY",
"api_url": "https://api.jikeapi.cn/v1/zodiac_sign",
"homepage": "https://www.jikeapi.cn/"
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"title": "星座查询 - 即刻数据",
"description": "星座查询。输入星座名称,查询星座特征、守护宫、阴阳性、守护星、幸运色、幸运数字、区间和男女特点。",
"env": "JIKE_ZODIAC_SIGN_QUERY_KEY",
"api_url": "https://api.jikeapi.cn/v1/zodiac_sign",
"homepage": "https://www.jikeapi.cn/"
}
The module description and later user-facing output strings indicate the skill is designed to communicate exclusively in Chinese. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.
"""
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