From 8af1e2bcf318bf655a71c48220b6879dca06b238 Mon Sep 17 00:00:00 2001 From: Richard Ockerby Date: Sat, 30 May 2020 23:18:56 +0100 Subject: [PATCH] If `httpContext.GetCurrentRequestIpAddress` is called with a spoofed HTTP context then IP returns null --- src/Umbraco.Core/Compose/AuditEventsComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Compose/AuditEventsComponent.cs b/src/Umbraco.Core/Compose/AuditEventsComponent.cs index 453fd6314a..033b46c13f 100644 --- a/src/Umbraco.Core/Compose/AuditEventsComponent.cs +++ b/src/Umbraco.Core/Compose/AuditEventsComponent.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Compose { var httpContext = HttpContext.Current == null ? (HttpContextBase) null : new HttpContextWrapper(HttpContext.Current); var ip = httpContext.GetCurrentRequestIpAddress(); - if (ip.ToLowerInvariant().StartsWith("unknown")) ip = ""; + if (ip == null || ip.ToLowerInvariant().StartsWith("unknown")) ip = ""; return ip; } }