Problems with Kerberos authentication when a user belongs to many groups

Support for Windows Vista Service Pack 1 (SP1) ends on July 12, 2011. To continue receiving security updates for Windows, make sure you're running Windows Vista with Service Pack 2 (SP2). For more information, refer to this Microsoft webpage: Support is ending for some versions of Windows.


When a user belongs to many groups, that user may have problems with authentication or with Group Policy settings. The following Microsoft Knowledge Base articles describe these symptoms in more detail:  

269643 Internet Explorer Kerberos authentication does not work because of an insufficient buffer connecting to IIS

280380 Buffer overflow exploit possible with extended stored procedures
2020943 "HTTP 400 - Bad Request (Request Header too long)" error in Internet Information Services (IIS)
The resolution that is described in these articles instructs you to modify the MaxTokenSize registry value. An improvement was made to this resolution. If you use the hotfix that is described in this article, you may not have to edit the default MaxTokenSize value.

The hotfix that is described in this article supersedes the hotfixes that are described in Microsoft Knowledge Base articles that are listed in this section.


The user cannot authenticate because the Kerberos token that is generated during authentication attempts has a fixed maximum size. Transports such as remote procedure call (RPC) and HTTP rely on the MaxTokenSize value when they allocate buffers for authentication. In Windows 2000 (the original release version), the MaxTokenSize value is 8,000 bytes. In Windows 2000 Service Pack 2 (SP2) and Windows Server 2003, the MaxTokenSize value is 12,000 bytes.

Kerberos uses the Privilege Attribute Certificate (PAC) field of the Kerberos packet to transport Active Directory Group membership. Starting with Windows Server 2012, this also applies to the Active Directory Claims information (Dynamic Access Control) field. If there are many group memberships for the user, and if there are many claims for the user or the device that is being used, these fields can occupy lots of space in the packet.

If a user is a member of more than 120 groups, the buffer that is determined by the MaxTokenSize value is not large enough. Therefore, users cannot authenticate, and they may receive an "out of memory" error message. Before you apply the hotfix that is described in this article, every group that is added to a user account increases this buffer by 40 bytes.

Note In many scenarios, Windows NTLM authentication works as expected. You may not see the Kerberos authentication problem without analysis. However, scenarios in which Group Policy settings are applied may not work as expected.


Important To resolve this problem, you must set the MaxTokenSize registry value for all the computers that are involved in the Kerberos authentication process. This includes the SQL Server clients. (That is, the registry key has to be set on each computer that is involved in the request/response flow. Therefore, if there is a SQL Server client on which a web application relies, or if the user’s token has to be passed to a backend SQL Server database, the registry key has to be set on the SQL Server client computer, the SQL Server database computer, and also the client computer that is running Internet Explorer, the web server running that is running IIS, and so on.)

Note The following Windows versions include a fix for this problem:
  • Windows 8
  • Windows Server 2012
  • Windows 7
  • Windows Server 2008 R2
  • Windows Server 2003
  • Windows Vista
  • Windows Server 2008
  • Windows XP Professional

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft Windows 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
260910 How to obtain the latest Windows 2000 service pack

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 2000 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, go to the following Microsoft website: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.
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.


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 Microsoft Windows 2000 Service Pack 4.

More Information

Token Size Calculation Windows 2000 to Windows Server 2008 R2

If you use the hotfix that is described in this article, you do not have to modify the MaxTokenSize registry value in most cases. However, there are some scenarios in which you have to modify the MaxTokenSize registry value after you apply this hotfix. After you apply this hotfix to all the domain controllers, use the following formula to determine whether you have to modify the MaxTokenSize value:
TokenSize = 1200 + 40d + 8s
This formula uses the following values:
  • d: The number of domain local groups a user is a member of plus the number of universal groups outside the user's account domain that the user is a member of plus the number of groups represented in security ID (SID) history.
  • s: The number of security global groups that a user is a member of plus the number of universal groups in a user's account domain that the user is a member of.
  • 1200: The estimated value for ticket overhead. This value can vary, depending on factors such as DNS domain name length, client name, and other factors.
In scenarios in which delegation is used (for example, when users authenticate to a domain controller), we recommend that you double the token size.

When to set the registry entry

If the token size that you calculate by using this formula is less than 12,000 bytes (the default size), you do not have to modify the MaxTokenSize registry value on domain clients. If the value is more than 12,000 bytes, see the following Microsoft Knowledge Base article for a description of how to adjust the MaxTokenSize registry value:

263693 Group Policy may not be applied to users belonging to many groups

  • When you change the MaxTokenSize value, you must restart the computer so that the change is effective.
The recommended value for the MaxTokenSize registry entry is 65535 decimal or FFFF hexadecimal. The MaxTokenSize value specifies a fixed Kerberos ticket receive buffer that contains the SIDs that represent the groups in which the account is a member.

To use a safe size, you can choose to set MaxTokenSize to 48000, following the discussion about a limitation introduced by HTTP header size later in this article. Depending on what value you are using, you first encounter a problem with Kerberos error events, or IIS HTTP 400 errors.

Known issues that you may encounter

Known issues for the Access Token size:

The Local Security Authority (LSA) service generates the user Access Token from this SID buffer. The hard-coded limit of customer definable SIDs for this token is 1,015, see this KB article:
328889 Users who are members of more than 1,015 groups may fail logon authentication

Therefore, a MaxTokenSize value for more than 1015 effective SIDs is not useful. In the following formula:
MaxTokenSize = 1200 + 40d + 8s
40d means that you have 40 bytes for a Domain Local Group SID. 8s means 8 bytes for a Domain Global/Universal Group SID.

Therefore, if you have a MaxTokenSize value of 0x0000FFFF (64K), you may be able to buffer approximately 1600 Domain Local Group SIDs or approximately 8000 Domain Global/Universal Group SIDs. If you use "trusted for delegation" accounts, the buffer requirement for each SID may be doubled. In these scenarios, you can only store approximately 800 Domain Local Group SIDs when a MaxTokenSize value of 64K is used. However, having only Domain Local Group SIDs is not a typical scenario. A value of 64K should be sufficient even for delegation scenarios.

Known issues when using values of MaxTokenSize larger than 65535

Previous versions of this article discussed values of up to 100000 bytes for MaxTokenSize. We have found that versions of SMS Administrator have problems when the MaxTokenSize is 100000 or larger. We have also identified that the IPSEC IKE protocol does not allow a security BLOB to become larger than 66536 bytes, and it would also fail when MaxTokenSize is set to a larger value.

Known issues for the Internet Information Server HTTP receive buffer

The Internet Information Server (IIS) uses a reduced request buffer size to mitigate a denial of service attack vector of 64 KB. However, a Kerberos Ticket in an HTTP request is encoded as Base64 (six bits expanded to eight bits). Additionally, and the Kerberos Ticket is using 133 percent of its original size. Therefore, when the maximum buffer size is 64 KB in IIS, 48 KB of a Kerberos Ticket can be used.

If you set the MaxTokenSize registry entry to a value that is larger than 48000, and the buffer space is used for SIDs, an IIS error may occur. However, if you set the MaxTokenSize registry entry to 48000, a Kerberos error may occur.

For more information about IIS buffer sizes, click the following article numbers to view the articles in the Microsoft Knowledge Base:
310156 How to limit the header size of the HTTP transmission that IIS accepts from a client in Windows 2000

920862 Error message when an Outlook Web Access user tries to access a mailbox in Exchange Server 2003: "HTTP 400 Bad Request (Request header too long)"

Windows Server 2012 changes

Windows Server 2012 introduced the following changes to the considerations about this buffer:
  • The default for MaxTokenSize changes to 48,000 bytes.
  • There is a new scheme for compressing the sids in the PAC.
  • Dynamic Access Control adds Active Directory Claims to the Ticket. Therefore, calculating the expected ticket sizes is no longer straightforward. The expectation is that tickets that are issued by Windows Server 2012 domain controllers are smaller than the same tickets that are issued from older operating system versions. Claims add to the ticket size. However, after Windows Server 2012 file servers are using claims broadly, you can expect to phase out a significant number of your groups that control file access to trim ticket sizes.

For more information about Windows Server 2012 changes, go to the following Microsoft TechNet website:

Examples of problems when the ticket size is exceeded

For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:

277741 Internet Explorer logon fails due to an insufficient buffer for Kerberos

313661 Error message: "Timeout expired" occurs when you connect to SQL Server over TCP/IP and the Kerberos MaxTokenSize is greater than 0xFFFF

Because you may have cross-domain logon scenarios in your forest, the value should be set forest-wide on all Windows-based systems. Therefore, we recommend that the maximum value for the MaxTokenSize value be 64K.

Important On SQL Server clients, you may receive the following error message when this problem occurs:
Cannot generate SSPI context
To resolve this problem, you must set the MaxTokenSize registry value for all the computers that are involved in the Kerberos authentication process. This includes the SQL Server clients.


Article ID: 327825 - Last Review: Jun 12, 2014 - Revision: 1