aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Relay/RelayClient.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-23 15:17:45 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-23 15:17:45 -0500
commit33110721157f48183ebac1161896ca0a4f7af196 (patch)
treeb85b9dbc498816dfefc1c1bf62c9041193940c50 /src/slskd/Relay/RelayClient.cs
parent8ba47ff14c2d65623f98a9d590ff17d97daee88e (diff)
downloadslskd-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.cs4
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 () =>