Repository navigation
Fix security vulnerabilities and modernize the transfer API - #6
Merged
Merged
Conversation
Replace the 0.1.x wire protocol, which let any network client write files anywhere on the server and crash the server process. Security fixes: - Path traversal: the server joined SaveTo with the client-supplied file name, so "..\..\x" or an absolute path wrote outside the save folder. Names are now validated (no separators, drive letters, "..", control characters, ADS or device names) and must resolve inside SaveDirectory. - Remote crash: malformed packets, duplicate names or early disconnects threw on a background thread and killed the process; EOF also caused infinite 100%-CPU loops. All connection errors are now contained. - Unbounded allocation from untrusted length fields. - Optional access-token auth (HMAC-SHA256 challenge, token never sent), optional TLS, and a SHA-256 integrity check on every transfer. - Idle timeouts, a concurrent-connection limit, an optional max file size and a free-space check. Uploads go to a hidden temp file that is deleted on failure; existing files are never overwritten. Modernization: - Async API: EftClient.SendFileAsync/SendAsync with IProgress and cancellation; EftServer.Start/StopAsync with FileReceived and TransferFailed events. The 0.1.x API is kept as [Obsolete] wrappers. - Remove the WarningsNotAsErrors list; the library builds warning-free. - Convert the WinForms samples to SDK-style net10.0-windows projects (they referenced files deleted in the previous commit) and add token and progress UI. - Add an xunit test project (72 tests on net8.0 and net10.0), a GitHub Actions CI workflow, Dependabot config, SECURITY.md and a new README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P2FYFNHLYir1f4N9VJvgsn
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.
Replace the 0.1.x wire protocol, which let any network client write files anywhere on the server and crash the server process.
Security fixes:
Modernization: