Skip to content

Commit

Permalink
Sanitize eventName in SSE server controller before logging it (#1061)
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
tnotheis and github-advanced-security[bot] authored Feb 27, 2025
1 parent ec80795 commit ba43896
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public void Deregister(string address)

public async Task EnqueueFor(string address, string eventName, CancellationToken cancellationToken)
{
_logger.LogDebug("Enqueueing event '{EventName}'", eventName);
var sanitizedEventName = eventName.Replace(Environment.NewLine, "").Replace("\n", "").Replace("\r", "");
_logger.LogDebug("Enqueueing event '{EventName}'", sanitizedEventName);

if (!_channels.TryGetValue(address, out var channel))
throw new ClientNotFoundException();
Expand Down

0 comments on commit ba43896

Please sign in to comment.