CORS on IIS6

⚠️ IIS 6 IS DEPRECATED AND UNSUPPORTED

IIS 6 reached end-of-life in 2015. It no longer receives security updates and should NOT be used in production.

  • Security Risk: Unpatched vulnerabilities
  • Compliance Risk: Fails modern security standards
  • Limited Features: Cannot implement secure CORS patterns

Action Required: Migrate to IIS 10 or later immediately.

This documentation is maintained for legacy systems only.

IIS 6 CORS Limitations

IIS 6 has severe limitations that make it unsuitable for secure CORS implementations:

For secure CORS: These limitations make IIS 6 unsuitable for modern web applications requiring proper CORS security. Upgrade to IIS 7.5 or later.

IIS 6 Configuration (Legacy Systems Only)

⚠️ Security Warning: Using Access-Control-Allow-Origin: * allows any website to access your resources. Always specify exact origins in production.

If you are absolutely required to use IIS 6 for a legacy system, follow these minimal steps:

  1. Open Internet Information Service (IIS) Manager
  2. Right click the site you want to enable CORS for and go to Properties
  3. Change to the HTTP Headers tab
  4. In the Custom HTTP headers section, click Add
  5. Enter Access-Control-Allow-Origin as the header name
  6. Enter * as the header value
  7. Click Ok twice

Additional Required Headers

Repeat the "Add" process to configure these headers:

Preflight Requests: IIS 6 cannot properly handle OPTIONS preflight requests through configuration alone. You must implement preflight handling in your application code (see below).

Application-Level Workaround

For those stuck on IIS 6, implement CORS at the application level for better security:

ASP Classic

<%
' ASP Classic - Application-level CORS (IIS 6)
' Add this to the top of your ASP pages

Dim allowedOrigins, requestOrigin, i
allowedOrigins = Array("https://example.com", "https://app.example.com")
requestOrigin = Request.ServerVariables("HTTP_ORIGIN")

' Validate origin
For i = 0 To UBound(allowedOrigins)
    If requestOrigin = allowedOrigins(i) Then
        Response.AddHeader "Access-Control-Allow-Origin", requestOrigin
        Response.AddHeader "Vary", "Origin"
        Exit For
    End If
Next

' Handle preflight OPTIONS request
If Request.ServerVariables("REQUEST_METHOD") = "OPTIONS" Then
    Response.AddHeader "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"
    Response.AddHeader "Access-Control-Allow-Headers", "Content-Type, Authorization"
    Response.AddHeader "Access-Control-Max-Age", "86400"
    Response.Status = "204 No Content"
    Response.End
End If

' Your application code continues...
%>

Why IIS 6 Cannot Do Modern CORS

Technical Limitations

  1. No Dynamic Headers: IIS 6 can only set static headers through GUI. Cannot validate request origin and respond with matching header.
  2. No HTTP Verb Filtering: Cannot configure different headers for OPTIONS vs GET/POST requests.
  3. Limited Configuration: No web.config support for custom headers, no modules/extensions for CORS.
  4. No Wildcard Alternatives: Cannot implement secure multi-origin CORS through configuration alone.

Security Implications

Migration Path

Upgrade to IIS 7.5+ (Strongly Recommended)

Modern IIS versions provide:

See IIS 7+ CORS documentation for modern IIS configuration.

Migration Checklist

  1. Audit current IIS 6 usage
    • Document all sites and applications
    • Identify CORS requirements per application
  2. Plan upgrade
    • Choose target platform (IIS 10 on Windows Server 2019+ recommended)
    • Test applications on new platform
    • Document breaking changes
  3. Implement secure CORS
    • Use web.config or IIS CORS Module
    • Validate origins properly
    • Handle preflight requests
    • Test thoroughly
  4. Decommission IIS 6
    • Migrate traffic to new servers
    • Archive old server
    • Update DNS/load balancers

Why You Must Upgrade

End-of-Life Status

Compliance and Risk

Additional Resources

Who’s behind this

Monsur Hossain and Michael Hausenblas

Contribute

The content on this site stays fresh thanks to help from users like you! If you have suggestions or would like to contribute, fork us on GitHub.

Buy the book

Save 39% on CORS in Action with promotional code hossainco at manning.com/hossain