T09 · Insecure Skill Coding Practices
- Location
portal_monitor.py:346- Finding
Default Third-Party Upload of a Live Authentication QR Code
- Content
View full analysis
Optional[str]: upload_cfg = CONFIG.image_upload if not upload_cfg.enabled: return None if upload_cfg.password_enabled and not upload_cfg.image_password: raise ValueError("image_upload.password_enabled 为 true 时,image_upload.image_password 不能为空。") form_data: dict[str, str] = {} output_format = upload_cfg.output_format.strip() if output_format: form_data["outputFormat"] = output_format cdn_domain = upload_cfg.cdn_domain.strip() if cdn_domain and cdn_domain.lower() != "default": form_data["cdn_domain"] = cdn_domain if upload_cfg.password_enabled: form_data["password_enabled"] = "true" form_data["image_password"] = upload_cfg.image_password with image_path.open("rb") as f: files = {"image": (image_path.name, f, "image/png")} resp = requests.post( upload_cfg.api_url, files=files, data=form_data, timeout=upload_cfg.request_timeout_seconds, ) ``` ```python output_path = save_login_qrcode_from_data_url(src) print(f"已提取登录二维码并保存到 {output_path},也已保存原始 data URL 到 {LOGIN_QRCODE_DATA_FILE}。") try: upload_url = upload_login_qrcode_if_enabled(output_path) if upload_url: print(f"已上传二维码到图床: {upload_url}") print(f"二维码链接也已写入 {CONFI ...[truncated 2356 chars]- Remediation
View remediation
