T09 · Insecure Skill Coding Practices
- Location
scripts/comfy_client.py:193- Finding
Stored ComfyUI Credentials Are Disclosed Through Agent Output
- Content
View full analysis
dict[str, Any]: cfg = _load_user_config() profiles = cfg.get("profiles") if isinstance(cfg.get("profiles"), dict) else {} servers = cfg.get("servers") if isinstance(cfg.get("servers"), list) else [] return { "active_profile": cfg.get("active_profile"), "default_server": cfg.get("default_server"), "default_workflow": cfg.get("default_workflow"), "profiles": {name: profile for name, profile in sorted(profiles.items()) if isinstance(profile, dict)}, "servers": [server for server in servers if isinstance(server, dict)], "config_path": str(USER_CONFIG_PATH), } ``` ```python def cmd_list_profiles() -> int: print(json.dumps({"status": "profiles", **list_profiles()})) return 0 def cmd_save_profile(args: argparse.Namespace) -> int: cfg = resolve_config() profile = { "base_url": cfg["base_url"], "port": cfg["port"], } if cfg.get("api_key"): profile["api_key"] = cfg["api_key"] if cfg.get("username"): profile["username"] = cfg["username"] if cfg.get("password"): profile["password"] = cfg["password"] out = save_profile(args.save_profile, profile, set_active=not args.no_activate) print(json.dumps({"status": "profiles", **out})) return 0 ``` ### Technical Analysis Saved profile objects may contain `api_key`, `username`, and `password`. The `list_profiles()` function returns those objects without redaction. Both profile listing and profile saving serialize the returned structure to stdout. In an Agent environment, stdout is returned to the caller and may also be retained in conversation history, execution logs, telemetry, or debugging records. Consequently, a profile-management operati ...[truncated 1022 chars]- Remediation
View remediation
