Skip to content

Fix the open CodeQL alerts: no user path for YouTube cookies, checked preview path - #143

Merged
ColinGPT9 merged 1 commit into
mainfrom
codeql-fixes
Oct 17, 2026
Merged

ColinGPT9 merged 1 commit into
mainfrom
codeql-fixes

Conversation

@ColinGPT9

Copy link
Copy Markdown
Owner

Fixes the 22 open code-scanning alerts on main.

Path injection (6, high)

  • YouTube cookies ([Bug] YouTube downloads fail with: "Sign in to confirm you're not a bot. Use --cookies-from-browser or --cookies for the authe #136): Settings → Advanced settings now sends the chosen cookies.txt's text.
    • The engine keeps it as youtube_cookies.txt in the data folder, so the setting is "", "firefox" or "file" and never a path.
    • The file must start with the Netscape header, as yt-dlp requires, and is capped at 1 MB.
    • It is deleted when the setting is turned off, and moving the original no longer breaks it.
    • The Electron pick-cookies-file IPC is removed.
  • Clip preview: the path of the preview that gets overwritten is checked with normpath + startswith(previews/).

Stack-trace exposure (3)

  • The note for a model file that can't be stored is now in our own words. The underlying error is logged.

Notes and warnings (13)

  • Unused globals (_ipv4_only, _told_missing) are now module dicts.
  • The three empty except blocks have comments saying why.
  • The store → registry import is now looked up by name.
  • The SDK submodules are imported by name.
  • Four test-file fixes.

Checks

  • Ruff and both tsc projects pass, and so do the cookies, preview, voice and API-contract tests.
  • On Windows, the full suite fails only in the files that already fail there on main.
  • The Settings flow was driven in the browser build against a scratch engine: a bad file is refused, a good one is saved and reads back after a reload, and Off deletes the copy.
  • Every accepted file loads in yt-dlp's YoutubeDLCookieJar.

🤖 Generated with Claude Code

… preview path

Path injection (high):
- YouTube cookies: Settings sends the cookies.txt's text, and the engine keeps it
  as youtube_cookies.txt in the data folder. The setting is now "", "firefox" or
  "file", never a path. The file must start with the Netscape header (yt-dlp
  refuses it otherwise), is capped at 1 MB, and is deleted when the setting is
  turned off. The Electron pick-cookies-file IPC is gone.
- Preview: the overwritten preview path is checked to sit inside previews/.

Stack-trace exposure: a model file's note in plugins/models.py is our own words;
the error goes to the log.

Notes and warnings: unused globals become module dicts, empty excepts say why,
the store -> registry import is looked up by name, the SDK submodules are
imported by name, and four small test-file fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clips-kitty-web Ready Ready Preview Oct 17, 2026 6:37pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
clips-studio Ignored Ignored Preview Oct 17, 2026 6:37pm UTC

@ColinGPT9
ColinGPT9 merged commit b5b0748 into main Oct 17, 2026
9 of 11 checks passed
@ColinGPT9
ColinGPT9 deleted the codeql-fixes branch October 17, 2026 18:36

This branch was successfully deployed

1 active deployment
Preview – clips-kitty-web — b852f0da Deployed Oct 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant