Skip to content

RC 0.3.9: harden process launching (CodeQL alert 1) - #7

Merged
DRAZY merged 3 commits into
mainfrom
rc/0.3.9
Sep 20, 2026
Merged

DRAZY merged 3 commits into
mainfrom
rc/0.3.9

Conversation

@DRAZY

@DRAZY DRAZY commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Release-candidate branch for the one open item under Security and quality: CodeQL js/shell-command-injection-from-environment on electron/engine/run.ts.

No shell was involved, but the class the alert points at had three real gaps, closed here:

  • run() now passes shell: false and refuses any command that is not an absolute path.
  • An installed app no longer falls back to PATH for yt-dlp, ffmpeg, aria2c or deno; it uses only the user-updated or bundled copy. PATH lookup remains for development and skips relative entries.
  • OS utilities (taskkill, attrib, tar, rundll32, shutdown, pgrep, open, osascript) are launched by absolute path. On Windows a bare name is searched for in the working directory before PATH.

Verification: typecheck, 33 unit tests (5 new), locale parity, release gate 14/14.

Draft on purpose: not for merge until reviewed. Opened so CodeQL analyses the branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_016MFr7iyxH3khcCfBGFyN8J

MAXIMUS and others added 3 commits September 20, 2026 12:21
…s, no PATH fallback when installed

- run(): explicit shell:false and a refusal of any command that is not an absolute path
- resolveTool(): an installed app resolves only user-updated and bundled tools; PATH lookup is dev-only and skips relative entries
- systools.ts: OS utilities (taskkill, attrib, tar, rundll32, shutdown, pgrep, open, osascript) by absolute path
- tests/spawn-safety.test.ts; watchdog tests use /bin/sh
- release gate restores the dev instance's settings and clears its rows, so no empty gate folder survives a run
- ISA decision and ISC-84

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MFr7iyxH3khcCfBGFyN8J
…e-flight updater

- checksum.ts: SHA-256 of the download must match the release's SHA2-256SUMS entry for exactly that file and, when present, GitHub's asset digest
- download and sums URLs pinned to the yt-dlp project's release storage; fail closed, nothing unverified reaches the disk
- engine.log records the verified hash, or REJECTED with the reason
- updateEngine() is single-flight: startup check, self-heal and the Settings button share one run (fixes "downloaded yt-dlp failed to run" when two overlapped)
- tests/checksum.test.ts; README; ISA decision and ISC-85

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MFr7iyxH3khcCfBGFyN8J
…can no longer hang; cleanup inventory rule; ISC-86

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MFr7iyxH3khcCfBGFyN8J
@DRAZY
DRAZY marked this pull request as ready for review September 20, 2026 19:35
@DRAZY
DRAZY merged commit ed23af4 into main Sep 20, 2026
4 checks passed
@DRAZY
DRAZY deleted the rc/0.3.9 branch September 20, 2026 19:39
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