[Enhancement]: Improve MachineKey (update insecure algorithms, add automatic key rotation)
Is there an existing issue for this?
- [x] I have searched the existing issues
Description of problem
Due to current cyberattacks, the MachineKey should be addressed with high priority.
DNN 10.0.1 still uses <machineKey decryption="3DES" validation="SHA1" /> by default.
- The current default for
decryptionin ASP.Net isAES(Source). AES became the standard, see AES-128 vs 3DES-168, - The current default for
validationin ASP.Net isSHA256(Source). SHA1 is insecure and should not be used anymore ("not permitted for purchase by the federal government", see NIST). - Additionally Microsoft “improved ASP.NET view state security and key management” in SharePoint, by adding an automatic machine key rotation every 30 days, to “minimizing the risk of key compromise” (Details). Such a mechanism should also be implemented for DNN.
Related to:
- https://github.com/dnnsoftware/Dnn.Platform/issues/4966
- SharePoint vulnerability CVE-2025-53770
- https://github.com/dnnsoftware/Dnn.Platform/issues/3365
Description of solution
- Change
machineKey.decryptiontoAES - Change
machineKey.validationtoHMACSHA256(or evenHMACSHA512) - Create a scheduled task that automatically changes
validationKey. It should run by default every 30 days. Similar as Microsoft does it in SharePoint by default. - Review whether chainging the
decryptionKeycan also be automated by a scheduled task. Probably it can't because encrypted settings (PortalSettings, HostSettings) can't be read anymore afterward.
Description of alternatives considered
Anything else?
When chainging the decryptionKey, existing encrypted settings must be set again, since they can't be decrypted/read anymore.
When changing the validationKey, existing login-sessions are invalidated. All users must sign in again.
My assessment is that, considering safety, both should be manageable. Users having a DNN-login must be informed before the change is done in production.
Do you plan to contribute code for this enhancement?
- [ ] Yes
Would you be interested in sponsoring this enhancement?
- [ ] Yes
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Changing the decryptionKey or validationKey seems to also break license activation of certain Extensions, like Document Exchange (DMX) from @donker. License must be reactivated afterward.
Yes and many other extensions also base their licensing "fingerprint" off one or both of those values. I am not completely against this idea (I think it is great for security) but it would needs to have a big big warning on what could potentially happen by doing so.
Changing the
decryptionKeyorvalidationKeyseems to also break license activation of certain Extensions, like Document Exchange (DMX) from @donker. License must be reactivated afterward.
If the community wants this change I'll be happy to adapt DMX.
Microsoft just released this Security Update for SharePoint:
Updates the Machine Key Rotation Job schedule from monthly to weekly and make sure that it's automatically triggered after each update cycle finishes.