From 62cf077ec126089b2a6a1e0c3933167cec4003de Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 23 Oct 2026 09:23:52 -0500 Subject: delete dump file after transmission --- src/slskd/Core/API/Controllers/ApplicationController.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/slskd/Core/API/Controllers/ApplicationController.cs') diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index c9af1296..fc2e31a7 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -36,6 +36,7 @@ namespace slskd.Core.API { using System; using System.Diagnostics; + using System.IO; using System.Threading.Tasks; using Asp.Versioning; using Microsoft.AspNetCore.Authorization; @@ -181,7 +182,9 @@ namespace slskd.Core.API Log.Warning("Dump complete"); - return PhysicalFile(file, "application/octet-stream", "slskd.dmp"); + // the dump contains everything in memory, including secrets. delete it once it has been sent + var stream = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.None, bufferSize: 4096, FileOptions.DeleteOnClose); + return File(stream, "application/octet-stream", "slskd.dmp"); } Log.Warning("Unauthorized attempt to dump application memory; Flags.Dumpable is disabled"); -- cgit v1.2.3