T09 · Insecure Skill Coding Practices
- Location
scripts/image_api.py:19- Finding
Unrestricted Credential-Bearing Image API Destination and Response-Driven SSRF
- Content
View full analysis
str: """下载图片到本地""" if url.startswith("data:"): # base64 数据直接写入 import base64 b64_data = url.split(",", 1)[1] with open(save_path, "wb") as f: f.write(base64.b64decode(b64_data)) else: resp = requests.get(url, timeout=30) resp.raise_for_status() with open(save_path, "wb") as f: f.write(resp.content) return save_path ``` ```python # scripts/publish.py:47-66 if os.path.isfile(config_path): with open(config_path, "r", encoding="utf-8") as f: config = json.load(f) log(f"已加载配置文件: {config_path}") else: log("未找到 config.json,将使用环境变量") wechat = config.get("wechat", {}) image = config.get("image_api", {}) return { "wechat_appid": wech ...[truncated 3562 chars]- Remediation
View remediation
