You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a couple of potential issues which might be hard to debug, for people using RemoteAddr() functions.
It does not seem to me that this comparison in context.go should care about string case. (Some people might expect to be able to configure X-FORWARDED-FOR rather than X-Forwarded-For and expect the same functionality.)
if headerName == xForwardedForHeaderKey {
...
}
This is maybe something that could be corrected in server configurations outside of the library, but simply taking the first IP in the X-Forwarded-For list opens up client spoofing. The issue (and a potential solution) is explained in more detail at the bottom of this article: https://husobee.github.io/golang/ip-address/2015/12/17/remote-ip-go.html. (Their solution would also probably require new Configuration options allowing users to specify the private subnets they want excluded, though.)
I noticed a couple of potential issues which might be hard to debug, for people using RemoteAddr() functions.
context.goshould care about string case. (Some people might expect to be able to configureX-FORWARDED-FORrather thanX-Forwarded-Forand expect the same functionality.)