T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/transcribe.py:284
- Finding
- Sensitive Transcript Data Exposed Through Undisclosed JSON Output and Console Preview## Vulnerability Details **File Location**: `scripts/transcribe.py:284-291` **Vulnerability Type**: Sensitive data exposure through excessive local output and logging **Risk Level**: Medium ### Vulnerable Code ```python json_path = str(Path(output_path).with_suffix(".json")) with open(json_path, "w", encoding="utf-8") as f: json.dump(raw_results if len(raw_results) > 1 else raw_results[0], f, ensure_ascii=False, indent=2) duration_info = "" if raw_results and isinstance(raw_results[0], dict): dur = raw_results[0].get("duration") or (raw_results[0].get("audio_info") or {}).get("duration") ``` The associated console exposure occurs immediately afterward: ```python print(f"\nDone! Transcript saved to: {output_path}{duration_info}") print(f"Raw JSON saved to: {json_path}") print(f"\nPreview (first 500 chars):\n{full_transcript[:500]}") ``` ### Technical Analysis The script creates a raw JSON sidecar in addition to the documented transcript text file. This JSON can contain the complete transcript and sensitive derived information, including speaker identities or labels, timestamps, sentiment results, translations, and audio metadata. The Skill documentation describes the transcript text output but does not clearly disclose this additional raw JSON artifact. The script also prints the first 500 characters of the transcript to standard output without requiring explicit user consent. Standard output is frequently retained by terminal capture systems, AI-agent execution logs, CI/CD systems, centralized telemetry, support diagnostics, or process supervisors. Both files are created using the process's default permission behavior. No explicit owner-only permissions are applied, so the effective accessibility depends on the user's `umask`, output directory permissions, and platform defaults. This exceeds the minimum data exposure required to provide a transcript: neither persistent raw API output nor a transcript p ...[truncated 1792 chars]
- Remediation
- ## Remediation Suggestions 1. Make raw JSON persistence opt-in through an explicit option such as `--raw-json-output FILE`; do not create it during normal transcription. 2. Remove the transcript preview from default console output. If previews are retained, require an explicit `--preview` option and warn that transcript content will be emitted to logs. 3. Clearly document every generated file, the information it contains, and its privacy implications. 4. Create transcript and JSON files with owner-only permissions where supported, such as mode `0600`, and avoid inheriting insecure default permissions. 5. Warn before overwriting existing output files and consider atomic file creation with exclusive creation semantics. 6. Provide a privacy mode that suppresses transcript content from stdout and avoids retaining raw API responses. 7. Recommend that users select a protected output directory and delete transcript artifacts when they are no longer required. 8. Close uploaded file handles deterministically by using a context manager around the file opened for the multipart request.
