Skip to content

Invalid HTTP request parsing in some network environments #1

@adelyte-chris

Description

@adelyte-chris

This issue is reproducible across at least two processor types (DIN-AP3 and DMPS-300-C) but only on one enterprise-class network.

Issue

Error

PM|Fatal|System.FormatException: An invalid IP address was specified. ---> System.Net.Sockets.SocketException: An invalid argument was supplied
  at System.Net.IPAddress.Parse(String ipString)
  at Crestron.SimplSharp.IPAddress.Parse(String ipString)
  at Crestron.SimplSharp.CrestronSockets.CrestronServerSocket.get_LocalEndPoint()
  at WebSocketSharp.Net.HttpConnection.get_LocalEndPoint()
  at WebSocketSharp.Net.HttpListenerRequest.get_LocalEndPoint()
  at WebSocketSharp.Net.HttpListenerRequest.get_UserHostAddress()
  at Waveguide.WebServer.<>cDisplayClass1.<.ctor>b0(Object sender, HttpRequestEventArgs args)
  at WebSocketSharp.Server.HttpServer.processRequest(HttpListenerContext context)
  at WebSocketSharp.Server.HttpServer.<>cDisplayClass1.<receiveRequest>b0(Object state)
  at SSMono.Threading.ThreadPool.doIt(Object state)
  at Crestron.SimplSharp.UserThreadStartDelegateWrapper.a(Object A_0)
  at System.Threading.Timer.ring()

Analysis

The property WebSocketSharp.Net.HttpListenerRequest.UserHostAddress is only supposed to be accessed if the incoming HTTP connection is an HTTP 1.0 connection and a host header is not provided. Nevertheless, it is being accessed in response to an HTTP 1.1 request fro several different user agents. For example, the error occurs with curl:

curl -sv -o /dev/null http://$PROCESSOR_IP_ADDRESS:80/

Steps

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions