Security hardening: 11 vulnerability fixes#1
Open
khalidelmerrah wants to merge 1 commit into
Open
Conversation
Critical: - Sanitize paths in self-update batch script to prevent command injection - Add symlink check in temp cleanup to prevent chmod on symlink targets - Validate download URLs are HTTPS from GitHub only, sanitize asset filenames High: - Use absolute System32 path in _check_vc_runtime to prevent DLL hijacking - Use subprocess.list2cmdline in relaunch_as_admin to prevent parameter injection Medium: - Remove dead _download_file_verified code - Cap log widget at 5000 lines to prevent memory exhaustion - Use os.lstat instead of os.stat in _snapshot_temp to avoid symlink following - Add threading.Lock for shared state between UI and worker threads UI: - Remove maxsize constraint to allow window maximizing - Fix SyntaxWarning in docstring Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Security audit found several vulnerabilities in the current codebase. This PR fixes all of them without changing any features, UI, or adding dependencies.
Critical fixes
",%,^,&,|could inject commands. Added_sanitize_batch_path()to strip dangerous charactersonerrcallback inclear_temp_asynccallsos.chmod()which follows symlinks. An attacker could plant a symlink in %TEMP% to modify system files. Addedos.path.islink()check before chmodos.path.basename()to prevent path traversalHigh fixes
_check_vc_runtime()loads DLLs by bare name, which searches CWD first. Changed to absolute%WINDIR%\System32pathsrelaunch_as_admin()joins argv with manual quoting that can be bypassed. Replaced withsubprocess.list2cmdline()for proper Windows escapingMedium fixes
_download_file_verifiedstatic method_snapshot_temp()now usesos.lstat()instead ofos.stat()threading.Lock()for shared state between UI and worker threadsUI fix
maxsizeconstraint so the window can be maximizedSyntaxWarningfor unescaped\Win docstringTest plan
No new dependencies. No UI changes beyond allowing maximize. Drop-in safe.
Generated with Claude Code