FIX: IP address is revealed in the content-location field in the TCP header in IIS 6.0

Article translations Article translations
Article ID: 834141 - View products that this article applies to.
Important This article contains information about how to edit the metabase. Before you edit the metabase, verify that you have a backup copy that you can restore if a problem occurs. For information about how to do this, see the "Configuration Backup/Restore" Help topic in Microsoft Management Console (MMC).
Expand all | Collapse all

On This Page

SYMPTOMS

When Microsoft Internet Information Services (IIS) receives a GET request without a host header, the Web server may reveal the IP address of the server in the content-location field or the location field in the TCP header in the response. This problem may occur if the request does not contain a specific page or if IIS must redirect the original request to another page.

CAUSE

This problem occurs because when IIS receives a GET request that has no host header, IIS must provide a host name or an IP address in the response.

RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
889100 How to obtain the latest service pack for Windows Server 2003
Important After you install the service pack, you must set either the UseHostName property or the SetHostName property on the site if you want an alternate host name to be sent for requests. For information about how to do this, see the "" section.

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows Server 2003 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

No prerequisites are required.

Restart requirement

You must restart your computer after you apply this hotfix.

Metabase information

After you apply this hotfix, you must set either the UseHostName property or the SetHostName property on the site if you want an alternate host name to be sent for requests. For information about how to do this, see the "" section.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
   Date         Time   Version      Size       File name
   ------------------------------------------------------
   10-Dec-2003  18:07  6.0.3790.91  1,124,352  Iiscfg.dll
   10-Dec-2003  18:07  6.0.3790.91    299,008  W3core.dll

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Windows Server 2003 Service Pack 1.

MORE INFORMATION

Warning If you edit the metabase incorrectly, you can cause serious problems that may require that you reinstall any product that uses the metabase. Microsoft cannot guarantee that problems that result if you incorrectly edit the metabase can be solved. Edit the metabase at your own risk.

Note Always back up the metabase before you edit it.

After you install the service pack or apply this hotfix, you must set either the UseHostName property or the SetHostName property on the site if you want an alternate host name to be sent for requests. By default, the same value as the HTTP_HOST variable is sent in the SERVER_NAME variable.

Note If you enable one the following settings, IIS will always use an alternate name for the SERVER_NAME variable.

The data type for the UseHostName property is Boolean. The UseHostName property will instruct IIS to always replace the SERVER_NAME variable with the fully qualified machine name.

Optionally, you can set the SetHostName property. The data type for the SetHostName property is string. Use the SetHostName property if you must specify a host name that is different from the computer name. The SetHostName property assumes that you want this alternate host name. The SetHostName property will cause IIS to ignore the UseHostName setting. You do not have to set the UseHostName property if the SetHostName property is present.

A Web server administrator may use the Adsutil.vbs tool to modify the UseHostName metabase property and the SetHostName metabase property.

Option 1: Set the UseHostName property

To set the UseHostName property, follow these steps:
  1. Click Start, click Run, type cmd, and then click OK to open a command prompt.
  2. Change to the folder where the Adsutil.vbs tool is located. By default, this folder is the following:
    %SYSTEMROOT%\Inetpub\AdminScripts
  3. Type the following command, where x is your site identifier:
    cscript adsutil.vbs set w3svc/x/UseHostName true

Option 2: Set the SetHostName property

To set the SetHostName property, follow these steps:
  1. Click Start, click Run, type cmd, and then click OK to open a command prompt.
  2. Change to the folder where the Adsutil.vbs tool is located. By default, this folder is the following:
    %SYSTEMROOT%\Inetpub\AdminScripts
  3. Type the following command, where x is your site identifier and hostname is the alternate host name that you want to use:
    cscript adsutil.vbs set w3svc/x/SetHostName hostname

Mitigating Factors

After you set the UseHostName or SetHostName properties in IIS 6.0, it is still possible to see the server’s IP address in an HTTP response. By default, this does not occur. It results from how the response is generated and sent. For example, if you configure an HTTP redirect that results in an HTTP 302 response being sent, and your redirect code uses the server’s IP address, the IP address may appear in the Content-Location or Location header of the response. To work around this issue, do not use the server’s IP address in the redirect logic. Instead, use its host name or fully qualified machine name.

A similar type of behavior can occur if you configure custom error pages to perform a REDIRECT operation and you use IIS Manager to set the redirect target as a URL instead of a file. In this scenario, specify the file instead of the URL to keep the IP address hidden.

The server's IP address can also be sent in an HTTP response if the following conditions are true:
  • The corresponding HTTP request did not include an HTTP:Host header value.
  • An ISAPI filter that makes a call to GetServerVariables(servername) during the SF_NOTIFY_PREPROC_HEADERS event is configured in IIS.
This is because PREPROC_HEADERS is called before IIS has read the configuration data; in this case, either UseHostName or SetHostName. Therefore, there is no other option but to return the IP address. If the request contains a Host value and the GetServerVariables(servername) call is made in PREPROC_HEADERS, SERVER_NAME will contain the value of the client's Host header. HTTP/1.1 Web browsers must include a Host header in their requests. Therefore, this scenario is much more likely to occur when the HTTP request is generated and sent by something other than a Web browser or when a Web browser uses HTTP/1.0.

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 834141 - Last Review: November 26, 2008 - Revision: 9.1
APPLIES TO
  • Microsoft Internet Information Services 6.0
Keywords: 
kbhotfixserver kbfix kbbug kbqfe kbwinserv2003presp1fix KB834141

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com