How to update AD schema to address CVE-2021-34470 if Exchange is very old or no longer installed
Published Aug 05 2021 12:54 PM 44.5K Views

In this blog post, we want to address two scenarios customers have asked us about the Active Directory schema vulnerability detailed in our July 2021 security update announcement.

Note: This blog post does not apply to customers who are in an Exchange Online hybrid configuration. Hybrid customers should follow the instructions in the July 2021 Security Update announcement to update their Active Directory schema.

Without explicit action by a schema admin in your organization, you might be vulnerable to CVE-2021-34470 if:

  • You ran Exchange Server in the past, but you have since uninstalled all Exchange servers.
  • You still run Exchange Server, but only versions older than Exchange 2013 (namely, Exchange 2003, Exchange 2007 and/or Exchange 2010).

If your organization is in one of these scenarios, we recommend the following to update your Active Directory schema to address the vulnerability in CVE-2021-34470:

  • Download the script Test-CVE-2021-34470.ps1 from GitHub and use it to apply the needed schema update; please note the script requirements on the GitHub page.

Even if your organization has uninstalled all your Exchange servers, the schema extensions made by Exchange to your Active Directory are not removed. If you ran Exchange Server in the past, your Active Directory schema was extended as a part of Exchange Server installation, and any Exchange schema extensions are still present in your organization (unless you completely rebuilt your Active Directory forest). Therefore, you might be vulnerable to CVE-2021-34470, and you should use the script to address this vulnerability.

The script makes only the change needed to address CVE-2021-34470, and no other schema changes are made. You can run the script in Test mode to see if your Active Directory schema is vulnerable to CVE-2021-34470. The script will also provide validation that CVE-2021-34470 is addressed if you have already updated your schema.

The Exchange Team

10 Comments
Copper Contributor

Hi,
thanks for the script !

It worked well on an english DC (Server 2019),

but not on other DCs with German GUI

On Windows Servers older than 2016, it is not easy to change the Windows language

 

Cannot index into a null array.
At C:\SETUP\CVE-2021-34470_Exchange\Test-CVE-2021-34470.ps1:55 char:92
+ $schemaMaster = (netdom query fsmo | Select-String "Schema master\s+(\S+)").Matches.Groups[ <<<< 1].Value
+ CategoryInfo : InvalidOperation: (1:Int32) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : NullArray

 

Thank you anyway

Michel

Copper Contributor

Hello again,

the script breaks on Line 55 because it uses the absolute String Schema master

On German (de-DE) Windows machines this String should be Schemamaster

The String for other languages can be found by manualy executing NETDOM QUERY FSMO

Once line 55 executes, the script will work better

And perhaps, when using the -ApplyFix parameter, on line 91, Group at the end of the line has to be replaced with Gruppe

Thanks anyway for your great work !

Michel

Copper Contributor

Hello again,

to let the script work on a DC with Windows 2008 R2, when using the -ApplyFix parameter

on line 91, sls should be replace with Select-String

Michel

Microsoft

@SoPy As with other GitHub scripts, it is best to report issues by opening an issue in GitHub; I will let the team know!

Microsoft

@SoPy All the above issues are fixed in the release that just went up:

 

* Language-agnostic check for Schema Master FSMO role

* sls is expanded to Select-String (our build process is supposed to catch the use of aliases, so not sure how that one slipped through)

* Schema Admins check is taken out entirely. Now we just attempt it, and if it fails, we display a message reminding that you need Schema Admin.

 

Thanks for letting us know!

Copper Contributor

If we have both 2010 and 2016 (with the most recent CU) in the forest are we vulnerable or does the latest CU for 2016 take care of this update?  We recently (last week) introduced the first 2016 Exchange server to our environment but still have a few 2010 servers.  

Microsoft

@Mike Celone As long as you applied CU21 for 2016, then this vulnerability is already fixed.

Copper Contributor

Hi,

Ran the script and it indeed found and fixed this vulnerability within our AD schema (we got rid of Exchange years ago).  After running repadmin /showreps /verbose I get the following error.  Any thoughts on this one?  Will this self correct after some time?  Thanks

 

CN=Schema,CN=Configuration,DC=our-domain,DC=com
Default-First-Site-Name\SVRDC19 via RPC
DSA object GUID: 542dfa59-2fed-4cb0-8108-fd1466060fa8
Address: 542dfa59-2fed-4cb0-8108-fd1466060fa8._msdcs.our-domain.com
DSA invocationID: dd5caf24-c7f2-4918-9371-6444ec14a7a8
SYNC_ON_STARTUP DO_SCHEDULED_SYNCS WRITEABLE
USNs: 11511636/OU, 11511636/PU
Last attempt @ 2021-08-06 15:08:17 was delayed for a normal reason, result 8542 (0x215e):
Schema information could not be included in the replication request.
Last success @ 2021-08-06 14:52:08.

Copper Contributor

@Cbsykes1 ,

I think you have problems with replication with others DC.

Copper Contributor

Thanks so much for the script. Helped to fix vulnerability reported in our AD. 

Co-Authors
Version history
Last update:
‎Aug 05 2021 12:54 PM
Updated by: