From fbd925f3177001fce875c576618d5ab60e888bc3 Mon Sep 17 00:00:00 2001 From: Xenne <144433308+Xenne93@users.noreply.github.com> Date: Sun, 16 Aug 2026 13:39:40 +0200 Subject: [PATCH] Fix 2 remaining log-forging alerts in ExecuteCommandWithResponse Sanitize the command parameter in the timeout/error log calls, which weren't covered by the earlier fix pass (a different method in the same file). --- .../Services/RconBackgroundService.Connections.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RustRconServerManager.Backend/Services/RconBackgroundService.Connections.cs b/RustRconServerManager.Backend/Services/RconBackgroundService.Connections.cs index c824c4c..1555653 100644 --- a/RustRconServerManager.Backend/Services/RconBackgroundService.Connections.cs +++ b/RustRconServerManager.Backend/Services/RconBackgroundService.Connections.cs @@ -252,12 +252,12 @@ public void SendRconCommand(string command, int serverId) } // Timeout - no response received - _logger.LogWarning("[ExecuteCommandWithResponse] Timeout waiting for response from server {ServerId} for command {Command}", serverId, command); + _logger.LogWarning("[ExecuteCommandWithResponse] Timeout waiting for response from server {ServerId} for command {Command}", serverId, command?.Replace("\r", "").Replace("\n", "")); return null; } catch (Exception ex) { - _logger.LogError(ex, "[ExecuteCommandWithResponse] Error executing command {Command} on server {ServerId}", command, serverId); + _logger.LogError(ex, "[ExecuteCommandWithResponse] Error executing command {Command} on server {ServerId}", command?.Replace("\r", "").Replace("\n", ""), serverId); return null; } }