Knowledge Base

Message when you try to run a CGI application in IIS: "Access denied"

Article ID: 160422

Article Last Modified on 12/3/2007


APPLIES TO


This article was previously published under Q160422
We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

SYMPTOMS

When you try to run a CGI application in IIS, you receive the following message:
Access denied

CAUSE

The problem occurs when the Anonymous account does not have rights to the CGI. When you try to launch the CGI application, IIS uses the Anonymous user. Because the account does not have rights to the file, the process fails to run and an error message is returned via STDOUT.

However, to IIS the process appears to launch and terminate normally. Because the Access Denied error message is placed in STDOUT, IIS has no way of knowing that the process failed. Therefore, it does not try any other authentication methods because the Anonymous account was able to launch the process. IIS uses the createprocessasuser API call to launch the CGI application. Createprocessasuser will terminate normally if the user does not have NTFS rights to that CGI/ISAPI application.

WORKAROUND

Use one of the following methods.

Warning Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

Note The following is the full path to the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ W3SVC\Parameters


Additional query words: iis

Keywords: kbprb KB160422