In ASP.NET applications, the <machineKey> element is critical for securing various application-level features, such as ViewState validation, authentication, membership credentials, and anti-CSRF tokens. This key ensures that the data encrypted or hashed by the application remains tamper-proof and confidential. When stored in the web.config file, extra care must be taken to protect the <machineKey> and the web.config file.
To mitigate the risks associated with the exposed machine keys, the following security measures should be applied (see Finding your machineKey type below for details on identifying your machine key "type"):
High Level Steps for the management of shared (static) <machineKey> within the web.config file:
Detailed Steps for the management of shared (static) machineKey:
Important:
To rotate a static <machineKey> within a Sitecore product environment, you can use the standard ASP.NET application instructions provided in the official Microsoft security blog: see Recommendations
To ensure a safe and smooth key rotation within your Sitecore product environments, follow the general recommendations below:
Note that after key rotation, old machine keys will no longer be valid. This means that any in-flight sessions involving ViewState (encrypted with an old machine key) will encounter an error and will be required to re-authenticate. For this reason, we recommend that all active sessions be terminated prior to key rotation and that key rotation be performed during off peak hours for the product.
Examples of the types of errors and actions a user may experience include:
If instances are shut down/quiesced and sessions terminated prior to <machineKey> rotation, then the only impact should be:
Note that while it is technically more difficult, AutoGenerate and Azure-managed machineKeys are also subject to exposure; for this reason, vigilance is required across your environment to monitor for suspicious or abnormal behaviour.
We recommend that you adopt Microsoft’s recommendations as appropriate for your environment if you suspect a compromise of your machineKeys.
From Microsoft: If a machine key has been publicly disclosed, the rotation of all machine keys should be initiated. If successful exploitation of publicly disclosed keys has occurred, rotating machine keys will not sufficiently address possible backdoors or persistence methods established by a threat actor or other post-exploitation activity, and additional investigation may be warranted.
To confirm the machineKey "type" used in your deployment, the <SITECORE_ROOT>\web.config file should be inspected.
If auto-generated keys are used, the <machineKey> will appear with the values similar to the following:
<machineKey decryptionKey="AutoGenerate" validationKey="AutoGenerate,IsolateApps" />
If Azure horizontal scaling is used, the <machineKey> is managed by Azure and the <machineKey> element will be "missing" from the web.config file. In this scenario, machine key management is handled by Azure as part of Platform management.
If you have static machine keys, the <machineKey> element will be present with exact key values, for example (note these are fabricated key examples):
<machineKey decryptionKey="D94AB5..." validationKey="90F219..." ... />
In this scenario you or your operational partner (which may include the Sitecore MCP team depending on your deployment model) are responsible for machine key lifecycle management including secure creation, ongoing protection and rotation as needed.
The following details are provided for customers who require additional information about various deployment, provisioning, and ongoing machineKey management scenarios.
Sitecore’s deployment tooling for XM, XP or XC (more commonly known as the Sitecore Experience Platform):
Environments that require multiple instances and are configured with a shared, static machine key for all instances. More details can be found in Sitecore’s Configure multiple Content Delivery instances documentation (step 6).
Customers (or their operational partner) are responsible for the configuration and management of their environment including machine keys.
With Managed Cloud Standard, Sitecore provisions the environment for the customer and hands over operational management to the customer or their operational partner.
With Managed Cloud Premium, Sitecore provisions the environment for the customer and the MCP Team is responsible for operational management of machine keys behalf of the customer.
Sitecore MCP Team is responsible for rotation of static machineKey and will work with customers to accomplish rotation as requested or required.
XM Cloud (SaaS) is managed by Sitecore. Sitecore is responsible for the management, including rotation, of machineKeys in the XM Cloud (SaaS) environment as needed.
When will this Knowledge Base link be made public?
The Knowledge Base article will be published as part of a Security Bulletin on or around September 3, 2025.
Can I share the Knowledge Base link with others?
These instructions are currently confidential and restricted to recipients of the associated notification email.
Can I share this list with others?
This link should be kept private and confidential until publication of the Security Bulletin to give all customers time to respond. This is how we help ensure the protection of all Sitecore customers.
How do I know if I have been compromised?
Microsoft’s announcement has provided a series of steps and checks to help you determine if your machine keys have been exposed and/or if your environment has been compromised.
Also, Sitecore recommends that you rotate your keys and institute a practice of regularly rotating machine keys.
How do I know if my machine keys have been made public?
Refer to Microsoft’s announcement and follow the provided guidance.
Microsoft has provided a list of hash values for identified publicly disclosed machine keys in their Github repository and recommends checking machine keys in your environment using the provided script.
Microsoft’s lists should not be considered to be authoritative or exhaustive, in that the disclosed keys may not be included in their list.
Sitecore recommends that you rotate your keys and institute a practice of regularly rotating them.
What do I do if I think that my keys have been disclosed?
Refer to Microsoft’s announcement and follow the provided guidance.
Here is an excerpt from the Microsoft announcement:
Note that if successful exploitation of publicly disclosed keys has occurred, rotating machine keys will not sufficiently address possible backdoors or persistence methods established by a threat actor or other post-exploitation activity, and additional investigation may be warranted.
Sitecore recommends that you rotate your keys and institute a practice of regularly rotating them.
I followed Sitecore’s instructions for deployment, am I vulnerable?
If you are using Sitecore Experience Platform version 9.0 deployed before 2017 and relied on the sample static key included in that release of the Sitecore documentation, your keys are publicly known.
We recommend you review your environment for suspicious activity and rotate your machine keys promptly.
What if I don’t have runtime protection in my environment?
We strongly recommend that you deploy a suitable Endpoint Detection and Response (EDR) or next-generation anti-virus technology, such as Microsoft Defender, within your environment and include the monitoring and action of alerts from the EDR in your overall security operations discipline.
How can I get Microsoft Defender added to my Managed Cloud account?
All Managed Cloud customers are eligible to deploy Azure Defender.
Customers are responsible for providing their own SOC services, either in-house or with their own managed security services provider.