diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-23 15:17:45 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-10-23 15:17:45 -0500 |
| commit | 33110721157f48183ebac1161896ca0a4f7af196 (patch) | |
| tree | b85b9dbc498816dfefc1c1bf62c9041193940c50 /src/slskd/Relay/RelayClient.cs | |
| parent | 8ba47ff14c2d65623f98a9d590ff17d97daee88e (diff) | |
| download | slskd-33110721157f48183ebac1161896ca0a4f7af196.tar.gz | |
halt processing if given a path with traversal
Diffstat (limited to 'src/slskd/Relay/RelayClient.cs')
| -rw-r--r-- | src/slskd/Relay/RelayClient.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs index fef16573..9a587d5e 100644 --- a/src/slskd/Relay/RelayClient.cs +++ b/src/slskd/Relay/RelayClient.cs @@ -375,6 +375,7 @@ namespace slskd.Relay { Log.Warning("Suspicious attempt to request file info containing unsafe path segments (one or more of path traversal characters '.' and '..'). Requested file: {filename}", filename); await HubConnection.InvokeAsync(nameof(RelayHub.ReturnFileInfo), id, false, 0); + return; } Log.Information("Relay controller requested file info for {Filename} with ID {Id}", filename, id); @@ -399,7 +400,8 @@ namespace slskd.Relay if (FileSafety.ContainsTraversalSegments(filename)) { Log.Warning("Suspicious attempt to request a file upload containing unsafe path segments (one or more of path traversal characters '.' and '..'). Requested file: {filename}", filename); - await HubConnection.InvokeAsync(nameof(RelayHub.NotifyFileUploadFailed), token); + await HubConnection.InvokeAsync(nameof(RelayHub.NotifyFileUploadFailed), token, "Requested filename contains unsafe path segments"); + return; } _ = Task.Run(async () => |
