You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(core): resolve path traversal, process launch safety, null-safety, OOM guard, and IPC key validation (#516)
- C1: GetTempDirectory() use StartsWith+Substring instead of string.Replace
for path computation to prevent incorrect path resolution when targetPath
is a substring of another path component (potential path traversal).
- H1: DiffPipelineOptions.MaxInputFileSize guard — configurable file size
limit checked before invoking the binary differ, preventing OOM on
oversized files. Default 0 = no limit (backward compatible).
- H2: Validate Process.Start return value across all strategy files
(Windows/Linux/Mac/Client/Abstract). Log PID on success, throw on null.
- H3: UnixPermissionHooks uses ArgumentList { "+x", mainApp } on .NET 6+
to avoid shell injection; netstandard2.0 fallback retains quoting.
- H4: SafeOnBeforeUpdateAsync returns false on hook exception so a faulty
hook does not silently allow the update to proceed.
- L4: Environments.Set/GetEnvironmentVariable validates key contains only
alphanumeric, underscore, hyphen, and dot chars to prevent path traversal.
- M2: HttpClientProvider sets 5-minute hard upper bound timeout as safety
net instead of InfiniteTimeSpan. Improve comment clarity.
- M3: StorageManager.GetAllFiles and CopyDirectory use dirName.StartsWith
instead of dirName.Contains for directory skipping.
- M4: GetTempDirectory and GetBackupDirectoryName use DateTime.UtcNow.
- M6: SilentPollOrchestrator dispatches ExceptionEventArgs via EventManager.
- M7: DefaultDirtyMatcher.Match adds ArgumentNullException guard.
- M8: GracefulExit.ShutdownAsync adds XML doc explaining CloseMainWindow()
behavior for console / headless processes.
- L1: CopyUnknownFiles skips files outside patch directory instead of
using the full absolute path. Fix comment wording.
- L2: AbstractStrategy: patchRoot in finally; sanitize version.Name as
subdirectory key (null-safe, strip path separators, guard . / ..).
- L5: Remove redundant File.Delete in EncryptedFileProcessContractProvider.
- L7: CallSmallBowlHomeAsync logs a warning when Bowl name is empty.
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments