T09 · Insecure Skill Coding Practices
- Location
scripts/transcribe.py:18- Finding
Global TLS Certificate Verification Disabled
- Content
View full analysis
Vulnerability Details
File Location:
scripts/transcribe.py:18-27
Additional Location:SKILL.md:31-35
Vulnerability Type: Improper certificate validation
Risk Level: MediumVulnerable Code
python import argparse import ssl import sys # Bypass SSL certificate verification issues common on macOS ssl._create_default_https_context = ssl._create_unverified_context import whisperThe insecure behavior is also explicitly recommended by the Skill documentation:
markdown 1. **Download audio track**: `yt-dlp -f "bestaudio" --extract-audio --audio-format mp3` - Audio tracks are generally unaffected by video quality or membership restrictions - For SSL certificate issues: set `ssl._create_default_https_context = ssl._create_unverified_context`Technical Analysis
The script replaces Python's default HTTPS context with an unverified context at process scope. Consequently, HTTPS clients that rely on the default context may no longer validate the remote server's certificate chain or hostname.
This override occurs before the
whisperpackage is imported and remains active throughout the process. Network operations initiated while loading a Whisper model, or by other imported components using the default SSL context, may therefore accept an untrusted or forged certificate.The issue compromises transport authentication. Encryption alone does not establish that the client is communicating with the intended server when certificate verification is disabled. Any independent artifact-integrity verification performed by a dependency may reduce the risk of modified model files, but it does not correct the missing server authentication and must not be assumed without verification.
Attack Path
- A user runs
scripts/transcribe.pyin an environment where the requested Whisper model is not already available locally. ssl._create_default_https_contextis globally r ...[truncated 1636 chars]
- A user runs
- Remediation
View remediation
Remediation Suggestions
-
Remove the process-wide certificate verification override:
python # Delete this assignment: ssl._create_default_https_context = ssl._create_unverified_context -
Allow Python and all dependencies to use the verified default TLS context:
python ssl.create_default_context() -
Correct local certificate-store problems rather than bypassing validation:
- Install or update the operating system's trusted CA certificates.
- Update Python's
certifipackage where applicable. - Configure a trusted organizational CA bundle for environments using an authorized TLS inspection proxy.
- Use
SSL_CERT_FILEor dependency-supported CA configuration to reference the validated bundle.
-
Fail securely when certificate validation fails. Report an actionable error and stop the download instead of retrying without verification.
-
Verify remotely downloaded model artifacts using a trusted cryptographic digest or signed manifest. Artifact verification should supplement TLS validation, not replace it.
-
Remove the insecure SSL-bypass recommendation from
SKILL.md. Replace it with guidance for repairing the trust store or supplying a narrowly scoped trusted CA bundle. -
If exceptional development diagnostics require an insecure mode, keep it disabled by default, display a prominent warning, prohibit its use with sensitive data, and scope it to a single request rather than changing the global HTTPS context.
-
