Solved

Allow X-Forwarded-For Headers to Site or No?

Posted on 2016-10-24
3
45 Views
Last Modified: 2016-10-25
So, this one is new for me and I need a breakdown on it.  I already Google'd about it but I want a answer from someone knowledgable in this matter.

We host multiple sites for clients.  The sites are on IIS servers behind a load balancer.  One of the sites we host is having issues when their customers try to access it behind a proxy.  They can access it when they disable "X-Forwarded-For" option on the proxy but can't access it when they enable.  

My question to you is should we enable it for these users?  I ready that hackers can use that option if they breach your network and can use it to spoof the IP they came in on.  So obviously for us this is a security issue.

I'm not even 100% sure where to enable this, I believe I would do it on the actual web server and not the firewall, but I need advice on the ramifications of if I do it to begin with.
0
Comment
Question by:cshepfam
3 Comments
 
LVL 76

Expert Comment

by:arnold
Comment Utility
On a proxy configuration X-forwarded-For deals with when proxies are chained.

Without understanding your situation it is hard to answer your question
Depending on your loadbalancer, you could add the X-Forwarded-FOR to the loadbalancer.

Direct access client would not care about this header entry, the proxy may benefit..

Are their proxy chained? local proxy that connects to another of their proxy at HQ which in turns contacts your loadbalaner, passing data to the IIS instance, etc.
0
 
LVL 61

Accepted Solution

by:
btan earned 500 total points
Comment Utility
Indeed the X-Forwarded-For (and User-Agent) HTTP headers can easily be spoofed by any user.

By default, to secure your site, it should reject any connections that are not from the IP of the proxy server (configure the web server or firewall to only accept the client IP of the proxy for web connections). That is likely why you have connection without enabling XFF header.

Also you should consider installing an SSL certificate onto the proxy, which each client machine can trust. This will enable the proxy server to decrypt traffic, add the appropriate IP address header (overwriting any set by the client) and then forward it onto your server. The server code can then safely check the XFF header to make sure it remains constant per user session.

HTTP header should not be used for any Access Control List (ACL) checks because it can be spoofed by attackers. Use the real IP address for this type of restrictions.
0
 
LVL 13

Author Closing Comment

by:cshepfam
Comment Utility
Thank you for the explanation.  It was the one I was looking for.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dealing with Locky ransomware... 13 76
SIEM traffic 5 25
optimal method deal ransomware in files folders 9 54
shd and spl analysis 3 58
Ransomware continues to be a growing problem for both personal and business users alike and Antivirus companies are still struggling to find a reliable way to protect you from this dangerous threat.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now