Repository navigation
Mask --hf-token in OSError + stderr log to prevent secret leak - #72
Merged
Merged
Conversation
run_insanely_fast_whisper raises OSError with the full subprocess command line on non-zero exit. That command line contains the user's HuggingFace token verbatim (--hf-token hf_xxxx...). The OSError propagates into: - RunPod's job status API response - Worker stdout (visible in Logs tab) - Any error tracking the caller wires up Anyone with access to those surfaces sees the plaintext token. Mask the token before logging-or-raising. Tokens passed via env var to the subprocess are still functional — only the displayed command line is sanitized. Good candidate for an upstream PR to zackees/transcribe-anything. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Owner
|
Right direction — this is a legitimate security fix, not a stylistic change. Confirmed against Filed #93 to track the underlying vulnerability — this PR closes it. A couple of small notes for the reviewer:
Recommend merging. Closes #93. |
This was referenced Jun 3, 2026
Closed
zackees
added a commit
that referenced
this pull request
Jun 4, 2026
Headline features since 3.2.10: - --device insane-flash: separate iso-env with pinned FlashAttention2 wheels (Windows x86_64, Linux x86_64/aarch64) on torch==2.7.0+cu128. Fails early with diagnostics when no controlled wheel is available, instead of silently falling back. (#90) - --device whisperx: parallel additive backend with wav2vec2 alignment + pyannote diarization. Does NOT replace --device insane. (#87) - --device sensevoice: FunASR/SenseVoiceSmall — non-autoregressive, multilingual (auto/zh/en/yue/ja/ko/nospeech), built-in fsmn-vad, optional cam++ diarization. (#101) - --align: opt-in WhisperX wav2vec2 forced-alignment post-pass for --device insane and --device insane-flash. Per-word {word,start,end, score} data plus tightened segment timestamps. Reuses the whisperx iso-env, no new deps in insane. (#102) - Read-only install support: backend venvs + static_ffmpeg cache moved from <site-packages>/transcribe_anything/venv/... to <user_cache_dir>/ transcribe-anything/..., overridable via TRANSCRIBE_ANYTHING_CACHE_DIR. Unblocks Nix-store / OS-package / multi-user / read-only-container installs. (#100) - Cloud / Serverless link to @victorkjung's RunPod fork for non-GPU users. (#94, #98) - Security: mask --hf-token in insane backend stderr + OSError to prevent HuggingFace token leaks in serverless logs. (#72) - audio.py: argv-list + shell=False + check=True for _convert_to_wav, closing the shell-injection surface in the URL-download path. (#96) README "New in 4.0!" section expanded with the full feature set; existing 3.2 / 3.1 announcements preserved beneath it. One-time upgrade cost: the venv-location move orphans existing 3.2 caches at the old path. First run of each backend after upgrade re-downloads its dependencies. Documented in the README.
zackees
added a commit
that referenced
this pull request
Jun 4, 2026
Headline features since 3.2.10: - --device insane-flash: separate iso-env with pinned FlashAttention2 wheels (Windows x86_64, Linux x86_64/aarch64) on torch==2.7.0+cu128. Fails early with diagnostics when no controlled wheel is available, instead of silently falling back. (#90) - --device whisperx: parallel additive backend with wav2vec2 alignment + pyannote diarization. Does NOT replace --device insane. (#87) - --device sensevoice: FunASR/SenseVoiceSmall — non-autoregressive, multilingual (auto/zh/en/yue/ja/ko/nospeech), built-in fsmn-vad, optional cam++ diarization. (#101) - --align: opt-in WhisperX wav2vec2 forced-alignment post-pass for --device insane and --device insane-flash. Per-word {word,start,end, score} data plus tightened segment timestamps. Reuses the whisperx iso-env, no new deps in insane. (#102) - Read-only install support: backend venvs + static_ffmpeg cache moved from <site-packages>/transcribe_anything/venv/... to <user_cache_dir>/ transcribe-anything/..., overridable via TRANSCRIBE_ANYTHING_CACHE_DIR. Unblocks Nix-store / OS-package / multi-user / read-only-container installs. (#100) - Cloud / Serverless link to @victorkjung's RunPod fork for non-GPU users. (#94, #98) - Security: mask --hf-token in insane backend stderr + OSError to prevent HuggingFace token leaks in serverless logs. (#72) - audio.py: argv-list + shell=False + check=True for _convert_to_wav, closing the shell-injection surface in the URL-download path. (#96) README "New in 4.0!" section expanded with the full feature set; existing 3.2 / 3.1 announcements preserved beneath it. One-time upgrade cost: the venv-location move orphans existing 3.2 caches at the old path. First run of each backend after upgrade re-downloads its dependencies. Documented in the README.
zackees
added a commit
that referenced
this pull request
Jun 4, 2026
Headline features since 3.2.10: - --device insane-flash: separate iso-env with pinned FlashAttention2 wheels (Windows x86_64, Linux x86_64/aarch64) on torch==2.7.0+cu128. Fails early with diagnostics when no controlled wheel is available, instead of silently falling back. (#90) - --device whisperx: parallel additive backend with wav2vec2 alignment + pyannote diarization. Does NOT replace --device insane. (#87) - --device sensevoice: FunASR/SenseVoiceSmall — non-autoregressive, multilingual (auto/zh/en/yue/ja/ko/nospeech), built-in fsmn-vad, optional cam++ diarization. (#101) - --align: opt-in WhisperX wav2vec2 forced-alignment post-pass for --device insane and --device insane-flash. Per-word {word,start,end, score} data plus tightened segment timestamps. Reuses the whisperx iso-env, no new deps in insane. (#102) - Read-only install support: backend venvs + static_ffmpeg cache moved from <site-packages>/transcribe_anything/venv/... to <user_cache_dir>/ transcribe-anything/..., overridable via TRANSCRIBE_ANYTHING_CACHE_DIR. Unblocks Nix-store / OS-package / multi-user / read-only-container installs. (#100) - Cloud / Serverless link to @victorkjung's RunPod fork for non-GPU users. (#94, #98) - Security: mask --hf-token in insane backend stderr + OSError to prevent HuggingFace token leaks in serverless logs. (#72) - audio.py: argv-list + shell=False + check=True for _convert_to_wav, closing the shell-injection surface in the URL-download path. (#96) README "New in 4.0!" section expanded with the full feature set; existing 3.2 / 3.1 announcements preserved beneath it. One-time upgrade cost: the venv-location move orphans existing 3.2 caches at the old path. First run of each backend after upgrade re-downloads its dependencies. Documented in the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_insanely_fast_whispercallssubprocess.list2cmdline(cmd_list)to render the full insanely-fast-whisper command, prints it to stderr (theRunning: ...line), and on non-zero exit raisesOSError(f\"Failed to execute {cmd}\"). If--hf-token <hf_xxxx>is incmd_list, the token leaks into:OSErrorargs, which propagates into:I personally hit this twice running transcribe-anything on RunPod Serverless before realizing the wrapper was the source — both times forcing a HuggingFace token rotation across multiple machines. The fix is local and tiny: regex-mask the token before any logging or raising.
The regex matches both
--hf-tokenand--hf_tokenvariants.The subprocess itself still receives the raw token via
cmd_list(which is passed toiso_env.open_procunchanged), so functionality is untouched. Only the displayed/raised string is sanitized.Diff summary