From 292752bb78984c84b4305f32226d7f226092a08a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 27 Apr 2012 10:22:43 -0700 Subject: [PATCH] MapImage security issue: better error messages --- OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index cc7ef9d73b..a612114130 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs @@ -132,16 +132,18 @@ namespace OpenSim.Server.Handlers.MapImage GridRegion r = m_GridService.GetRegionByPosition(UUID.Zero, x * (int)Constants.RegionSize, y * (int)Constants.RegionSize); if (r != null) { - if (r.ExternalEndPoint.Address != GetCallerIP(httpRequest)) + System.Net.IPAddress ipAddr = GetCallerIP(httpRequest); + if (r.ExternalEndPoint.Address != ipAddr) { - m_log.WarnFormat("[MAP IMAGE HANDLER]: IP address {0} may be rogue", httpRequest.RemoteIPEndPoint.Address); + m_log.WarnFormat("[MAP IMAGE HANDLER]: IP address {0} may be trying to impersonate region in IP {1}", ipAddr, r.ExternalEndPoint.Address); return FailureResult("IP address of caller does not match IP address of registered region"); } } else { - m_log.WarnFormat("[MAP IMAGE HANDLER]: IP address {0} may be rogue", httpRequest.RemoteIPEndPoint.Address); + m_log.WarnFormat("[MAP IMAGE HANDLER]: IP address {0} may be rogue. Region not found at coordinates {1}-{2}", + httpRequest.RemoteIPEndPoint.Address, x, y); return FailureResult("Region not found at given coordinates"); } }