T09 · Insecure Skill Coding Practices
- Location
scripts/cloud_cli.py:12- Finding
Arbitrary Local Text Files Can Be Included in Remote Rendering Requests
- Content
View full analysis
str: """CLI argument: read an existing file path, otherwise treat it as literal text.""" raw = (value or "").strip() if not raw: return "" path = Path(raw) if path.is_file(): return path.read_text(encoding="utf-8") return raw ``` ```python # scripts/run.py:55-68 if args.render_data: payload["render_data"] = read_text_arg(args.render_data) if args.title: payload["title"] = args.title.strip() if args.subtitle: payload["subtitle"] = args.subtitle.strip() if args.headers: payload["headers"] = read_text_arg(args.headers) if args.rows: payload["rows"] = read_text_arg(args.rows) if args.specs: payload["specs"] = read_text_arg(args.specs) if args.features: payload["features"] = read_text_arg(args.features) ``` ```python # scripts/yufluent_api.py:232-235 root = base_url or os.getenv("TOKENAPI_BASE_URL", "") url = skill_run_url(root, skill_id) try: resp = _post_json(url, api_key=key, body=payload, timeout=timeout) ``` ### Technical Analysis The CLI accepts either literal structured data or an existing filesystem path for several arguments. If a supplied value resolves to any readable file, the implementation reads the entire file as UTF-8 text. It does not enforce: - A permitted workspace or data directory - Expected file extensions - JSON parsing or schema validation - A maximum file size - Confirmation before reading files outside the project - Rejection of credential, configuration, or other sensitive paths The resulting file contents are placed in the payload and submitted to the configured rendering service. The declared functionality only requires str ...[truncated 1441 chars]- Remediation
View remediation
