T09 · Insecure Skill Coding Practices
- Location
scripts/geocoder.py:210- Finding
CSV Formula Injection Through Unsanitized API Response Fields
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a straightforward Baidu Maps geocoding helper that sends user-provided location queries to Baidu and saves the returned coordinates locally.
Install only if you are comfortable sending your search terms, addresses, and Baidu AK to Baidu Maps. Use a virtual environment for dependencies, avoid privileged installs, and treat exported CSV files as untrusted third-party data when opening them in spreadsheet apps.
scripts/geocoder.py:210CSV Formula Injection Through Unsanitized API Response Fields
SKILL.md:42Unpinned Third-Party Dependency Installation
The skill explicitly describes making outbound Baidu API requests and saving results to CSV/JSON, but the manifest does not declare any tool scope or permissions for network and file-write behavior. This weakens user and platform transparency, making it easier for a skill to exfiltrate user-supplied data or write unexpected local artifacts without clear upfront consent.
The workflow sends user-provided keywords/addresses and an AK-authenticated request to Baidu's external API, then stores returned data locally in CSV/JSON, but the skill text does not clearly warn users about this data transfer and retention. This creates a privacy and data-handling risk, especially if users submit sensitive locations or proprietary lists of places.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
print(f"\n🌐 正在搜索「{keyword}」相关地点...\n")
url = "https://api.map.baidu.com/place/v2/search"
results = []
page_num = 0
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
print(f"\n🌐 正在搜索「{keyword}」相关地点...\n")
url = "https://api.map.baidu.com/place/v2/search"
results = []
page_num = 0
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
}
try:
resp = requests.get(url, params=params, timeout=10)
data = resp.json()
except Exception as e:
print(f" ⚠️ 第 {page_num + 1} 页请求失败:{e}")
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
geo_url = "https://api.map.baidu.com/geocoding/v3/"
geo_params = {"address": address or name, "output": "json", "ak": ak}
try:
resp = requests.get(geo_url, params=geo_params, timeout=10)
geo_data = resp.json()
except Exception as e:
print(f" [{i:02d}/{len(place_list)}] {name}")
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
json_file = f"lnglat_{safe}.json"
# CSV
with open(csv_file, "w", encoding="utf-8-sig", newline="") as f:
writer = csv.DictWriter(f, fieldnames=[
"序号", "名称", "详细地址", "BD-09经度", "BD-09纬度", "坐标来源", "类型", "置信度", "状态"
])
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
})
# JSON
with open(json_file, "w", encoding="utf-8") as f:
json.dump(results, f, ensure_ascii=False, indent=2)
return csv_file, json_file
The module description and user-facing usage instructions are entirely in Chinese, and the interactive prompts throughout the script follow the same pattern. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly justified.