How Could Standard Users Read the SAM in HiveNightmare?

· · Windows, Information Security, VSS, Access Control, CVE

Post on X
Revision history (first version, published Nov 1, 2026)
First published
Cite this article(DOI: 10.5281/zenodo.23856466)

This article is archived on Zenodo. Below are both the DOI that always resolves to the latest version and the DOI pinned to the version you are reading.

Go Komura (2026). How Could Standard Users Read the SAM in HiveNightmare?. KomuraSoft LLC. https://doi.org/10.5281/zenodo.23856466 https://comcomponent.com/en/blog/windows-hivenightmare-cve-2021-36934-sam/

DOI (latest version)
10.5281/zenodo.23856466
DOI (this version)
10.5281/zenodo.23856467

Windows local accounts are stored in a database called the SAM (Security Accounts Manager). Physically, it is a registry hive file in %windir%\system32\config, which standard users should not be able to read.12

In July 2021, it was disclosed that on several versions of Windows 10, standard users could read the files in this folder. This was CVE-2021-36934, known as HiveNightmare or SeriousSAM. The read path was Volume Shadow Copies, which are created for restore points and similar purposes. For that reason, it was also a vulnerability that installing the fix alone did not resolve.34

1. Overview

CVE-2021-36934 is a Windows elevation of privilege vulnerability published on July 20, 2021. Microsoft cites overly permissive access control lists (ACLs) on multiple system files, including the SAM database, as the cause, and states that an attacker who successfully exploited it could run arbitrary code with SYSTEM privileges.54

Item Details
CVE CVE-2021-369345
Microsoft’s name Windows Elevation of Privilege Vulnerability5
Common names HiveNightmare, SeriousSAM6
Published July 20, 2021 (fix released August 10, 2021)57
Affected feature ACLs on the SAM and other system files in %windir%\system32\config48
Nature of the problem Read permission granted to standard users8
Severity Important. CVSS 3.1 base score 7.8 (Microsoft’s rating)5
Main impact Local elevation of privilege (code execution with SYSTEM privileges)4
Known exploitation Yes. CISA added it to the Known Exploited Vulnerabilities Catalog on February 10, 20229

Microsoft’s record at the time of publication listed exploitation as “No” and public disclosure as “Yes”. Its exploitability assessment was “Exploitation More Likely”. CISA later added it to the Known Exploited Vulnerabilities Catalog.59

How HiveNightmare leads to elevation of privilegeShows the flow in which standard users get read permission on the SAM and other files, can read the copies if shadow copies exist, and this leads to elevation of privilege.NoYesUsers have read permission on SAM and other filesIs there a shadow copy of the system drive?No path to read a copyStandard users can read the SAM in the copyPassword hashes and more can be extractedLeads to execution with SYSTEM privileges

Figure 1: The wrong permissions and the shadow copies together created a path for reading the SAM.84

In the diagram a solid line marks a relation that always holds and a dashed line marks a conditional one (the conditions are given per relation on the detail page). The full list of relations (12 in total, with evidence and certainty) and the definitions of the main concepts are collected on the knowledge map detail page (in Japanese). Data: JSON-LD / Turtle

2. Affected Systems

The versions Microsoft listed for the update are Windows 10 versions 1809, 1909, 2004, 20H2 and 21H1.10 The list added in a revision the day after publication also included Windows Server, but the revisions of July 23 and 27, 2021 removed it as not affected.7

Version Fix Build after the fix
Windows 10 version 1809 KB5005030 17763.2114
Windows 10 version 1909 KB5005031 18363.1734
Windows 10 version 2004 KB5005033 19041.1165
Windows 10 version 20H2 KB5005033 19042.1165
Windows 10 version 21H1 KB5005033 19043.1165

Table: Updates and build numbers listed in MSRC’s machine-readable data.10

The attacker must be able to execute code on the target PC.4 The CVSS attack vector is also “Local”.5 On top of that, a Volume Shadow Copy of the system drive must exist. CERT/CC notes that some configurations have no shadow copies, but explains that if the system drive is larger than 128 GB, shadow copies are created automatically by Windows Update or by installing an MSI.811

Conditions under which HiveNightmare worksShows that it works on an affected Windows 10 version when the attacker can execute code and a shadow copy of the system drive exists.Not affected1809 to 21H1NoYesNoYesIs it an affected Windows 10 version?Not affectedCan the attacker execute code on the PC?Cannot be targeted with this vulnerability aloneIs there a shadow copy of the system drive?No read pathThe SAM copy can be read

Figure 2: It was a vulnerability for an attacker already running on the PC to raise their privileges.48

3. Details

The SAM lives in a registry hive file

The registry is stored in files in units called hives. A hive is a group of keys and values loaded into memory when the system starts or a user logs on. Most of them are in %SystemRoot%\System32\Config: HKEY_LOCAL_MACHINE\SAM corresponds to a file named Sam, HKEY_LOCAL_MACHINE\Security to Security, and HKEY_LOCAL_MACHINE\System to System.1

The SAM is a database that stores local user accounts and groups. When logging on with a local account, the LSA (Local Security Authority) validates the credentials by checking the SAM. Microsoft explains that the copy of the SAM in the registry and the local security policy are accessible only to the system.2

How registry hives map to filesShows that the SAM, Security and System hives under HKEY_LOCAL_MACHINE are stored in files of the same names in the Config folder under System32.HKEY_LOCAL_MACHINESAM hiveSecurity hiveSystem hiveFiles in the Config folderSam, Security, System

Figure 3: The contents of the SAM are stored on disk as files in the Config folder.1

The Users group had read permission

According to CERT/CC, on affected Windows 10 systems the files in %windir%\system32\config granted the BUILTIN\Users group read and execute (RX) permissions. CERT/CC describes this as allowing users who are not administrators to read these files.38

CERT/CC shows how to check by running the following command from a command prompt that is not elevated.12

icacls %windir%\system32\config\sam

On an affected system, the output includes BUILTIN\Users:(I)(RX). (I) means a permission inherited from the parent folder, and RX means read and execute access. On a system that is not affected, access is denied.1213

Telling the state apart from the icacls resultShows running icacls on the SAM file from a non-elevated prompt and telling the state apart by whether Users' read permission is shown or access is denied.BUILTIN\Users:(I)(RX) is shownAccess is deniedRun icacls from a non-elevated promptResultAffected stateNot affected

Figure 4: Whether a system is affected is told apart from the result when run with standard user rights.12

Shadow copies became the read path

Even with the read permission in place, the conditions for exploitation include the presence of shadow copies. CERT/CC and CISA both explain that if a shadow copy of the system drive exists, standard users can read these files.89

Hive files are loaded into memory at startup and are in use by the running Windows system.1 The Volume Shadow Copy Service (VSS) is a mechanism that creates a consistent copy of a volume at a point in time, and the shadow copies it creates are read-only. Restore points also use this mechanism. Microsoft explains that backup applications also use shadow copies to read locked or running files.1415 It appears that what was read was not the live hive files but the same files preserved in a point-in-time shadow copy.16

Live files and shadow copiesShows that separately from the hive files used by the running Windows system, a shadow copy keeps the files and their permissions from a point in time as read-only.System driveLive hive filesShadow copy (point-in-time copy)In use by WindowsFiles kept read-onlyPermissions readable by Users are kept too

Figure 5: A shadow copy keeps the files as they were when it was created, permissions included.1417

Why the update alone did not fix it

The August 2021 update fixed the ACLs on specific system files, including the SAM. It did not, however, fix the ACLs on every file in %windir%\system32\config. Microsoft explains that this was to avoid unexpected behavior.18

What the update fixes is the permissions of the live files. Because shadow copies are read-only, shadow copies created before the update still contain files with the loose permissions.144 CERT/CC explains that shadow copies newly created after the ACLs are fixed have the correct ACLs.17 That is why Microsoft says the vulnerability is not fully mitigated unless all shadow copies of the system volume are deleted after the update.4

As for why the update did not also delete them, Microsoft explains that it was to avoid deleting shadow copies of users’ data without their consent.18

What remains in shadow copies before and after the updateShows that the update fixes the ACLs of the live files, but shadow copies created before it keep files with loose ACLs, so the read path remains until they are deleted and recreated.NoYesShadow copies created before the updateFiles with loose ACLs remainAugust 2021 updateFixes the ACLs of the live filesWere the old shadow copies deleted?New shadow copies have correct ACLs

Figure 6: The update fixed the live files, and deleting the old shadow copies was left to users.41817

4. Impact

Microsoft states that an attacker who successfully exploited the vulnerability could run arbitrary code with SYSTEM privileges, install programs, view, change or delete data, and create new accounts with full user rights.4

CERT/CC lists the following possible impacts of being able to read these files.8

  • Extracting and using account password hashes
  • Discovering the original Windows installation password
  • Obtaining the computer’s DPAPI keys and decrypting all of the computer’s private keys
  • Obtaining a computer machine account and using it in a silver ticket attack

The impact does not necessarily stay inside that PC. Microsoft explains that local administrator accounts often share the same password across many devices, and that attackers exploit this to move laterally.19 If the password behind an extracted hash is also used for the local administrator on other PCs, the damage can spread beyond that PC.20

The impact that spreads from being able to read the SAMShows that being able to read the SAM and other files can lead to elevation of privilege on that PC and to lateral movement to other PCs that share the local administrator password.if the same password is reusedSAM and other files can be readPassword hashes can be extractedDPAPI keys and computer account informationRaise privileges on that PCLateral movement to other PCs

Figure 7: If local administrator passwords are reused, an elevation of privilege on one PC can spread to other PCs.819

5. Mitigation

Apply the August 2021 update or later

First, apply the August 2021 security updates (KB5005030, KB5005031, KB5005033) or later to the affected versions.107 As a workaround for systems that could not be updated, Microsoft advised running the following command from an elevated command prompt to restrict access to the contents of %windir%\system32\config.21

icacls %windir%\system32\config\*.* /inheritance:e

Whether you use the workaround or apply the update, that alone is not enough. Microsoft says that both restricting access and deleting the shadow copies are required.21

Delete the shadow copies after the update

KB5005357 shows the steps for listing and deleting the shadow copies of the system drive. Run both from an elevated command prompt.22

vssadmin list shadows /for=%systemdrive%
vssadmin delete shadows /for=%systemdrive% /Quiet

After deleting, run vssadmin list shadows again; if it shows “No items found that satisfy the query.”, no shadow copies remain on the system drive.22

Deleting them has consequences. Restore points that depend on the deleted shadow copies can no longer be used, and applications that use shadow copies directly also lose access to earlier restore points.15 Deleted shadow copies cannot be recovered.23 Before deleting, you need to check which backups rely on shadow copies.

Steps for deleting the shadow copiesShows applying the update, listing the shadow copies and checking the impact, deleting them and confirming the list is empty, and creating a new restore point if needed.Some remainEmptyApply the August 2021 update or laterList the shadow copiesCheck dependent restore points and backupsDelete the shadow copiesIs the list empty?Check what backup products manageCreate a new restore point if needed

Figure 8: Create new restore points only after dealing with the vulnerability.2224

vssadmin delete shadows can delete only shadow copies of the client-accessible type. Other shadow copies are managed with diskshadow.23 On Windows Server, shadow copies created by other backup products, such as wbadmin, must be managed within those products.25

If you need a new restore point, create it after the deletion. KB5005357 shows that one can be created with PowerShell’s Checkpoint-Computer, and that it must be created only after dealing with the vulnerability.24

Check the ACLs after restoring from a backup

Microsoft cautions that restoring a system from a backup can also restore the overly permissive ACLs and return it to the affected state. After a restore, you need to confirm that the ACLs are correct.21 The check is the same icacls command shown in an earlier section.

Checking after restoring from a backupShows that restoring from a backup taken before the update can bring back loose ACLs, so after restoring you check the ACLs with icacls and redo the update and the shadow copy deletion if needed.NoYesRestore the system from a backupCheck the ACLs with icaclsDo Users have read permission?Not affectedApply the update againDelete the shadow copies again

Figure 9: A restore can bring back the permissions from before the update.21

Use a different local administrator password on each device

It is not a measure the CVE-2021-36934 advisory asks for, but Windows LAPS is a way to limit how far the impact spreads. Windows LAPS regularly changes and stores the local administrator password for each device, and Microsoft lists protection against pass-the-hash and lateral-traversal attacks among its benefits.19 How to deploy it is explained in A Practical Guide to Windows LAPS.

The overall mitigation for HiveNightmareShows applying the update, deleting the shadow copies and checking the ACLs after restores in order, with managing local administrator passwords added as a separate measure that limits how far the impact spreads.a separate measure that limits spreadAugust 2021 update or laterDelete the shadow copiesCheck the ACLs after restoresUse Windows LAPS for per-device passwords

Figure 10: Treat the three measures the advisory asks for separately from the measure that limits lateral movement.2119

6. Lessons

What follows are design and operational observations drawn from the published history and mitigations.

In HiveNightmare, even after the update fixed the permissions of the live files, the old permissions preserved in shadow copies were not fixed. A check of the ACLs is also required after a restore.421 This suggests that when fixing the permissions of a file, you need to think about the mechanisms that hold copies of that file as well. Shadow copies and backups preserve not only the contents at the time they were made but also the permissions at that time.

Microsoft left the deletion of shadow copies to users in order not to delete users’ data without their consent.18 For vulnerabilities that need manual work after the update, a record that the update was applied is not enough to judge whether the system is protected. Check whether the advisory says “the update alone is not enough”, and add the remaining steps to your checklist.

What an attacker gained with this vulnerability was local elevation of privilege.5 Even so, if local administrator passwords are shared between devices, a hash extracted on one device may work on others as well.19 An elevation of privilege vulnerability looks like a single-PC problem, but whether each device uses different credentials determines how far the damage reaches.

This article explains the mechanism and the mitigations based on published primary sources. No operation to read files from shadow copies and no reproduction of the elevation of privilege was carried out.

References

The footnotes on the body text, tables and figures, and the source links in the FAQ, lead to the sections and items of the supporting documents. Where an explanation was assembled from the documents or is a design observation, the footnote says so. All sources were checked on November 1, 2026.

  1. Microsoft Learn, Registry Hives. Sections referenced: a set of supporting files loaded into memory when the operating system is started or a user logs in at the beginning, Most of the supporting files for the hives are in the %SystemRoot%\System32\Config directory, and the table of standard hives and files (Sam for HKEY_LOCAL_MACHINE\SAM, Security for HKEY_LOCAL_MACHINE\Security, System for HKEY_LOCAL_MACHINE\System). ↩ ↩2 ↩3 ↩4

  2. Microsoft Learn, Credentials Processes in Windows Authentication. Sections referenced: in the Security Accounts Manager database section, a database that stores local user accounts and groups, the LSA can validate user information by checking the Security Accounts Manager (SAM) database, and The Registry contains a copy of the SAM database, local security policy settings, default security values, and account information that is only accessible to the system. ↩ ↩2

  3. CERT Coordination Center, VU#506989: Microsoft Windows 10 gives unprivileged user access to system32\config files. Sections referenced: Multiple versions of Windows 10 grant non-administrative users read access to files in the %windir%\system32\config directory in Overview, and the publication date (2021-07-20). ↩ ↩2

  4. Microsoft Security Response Center, machine-readable data for CVE-2021-36934. Sections referenced: search terms in description: overly permissive Access Control Lists (ACLs) on multiple system files, including the Security Accounts Manager (SAM) database, run arbitrary code with SYSTEM privileges, must have the ability to execute code on a victim system, and Simply installing this security update will not fully mitigate this vulnerability. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12

  5. Microsoft Security Response Center, machine-readable data for CVE-2021-36934 (Security Update Guide). Sections referenced: cveTitle, releaseDate, severity, impact, baseScore, vectorString, exploited, publiclyDisclosed, latestSoftwareRelease. Basis for the name, publication on July 20, 2021, Important, elevation of privilege, CVSS 3.1 base score 7.8 with a Local attack vector (AV:L), exploitation “No” and public disclosure “Yes” at the time of publication, and “Exploitation More Likely”. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8

  6. CERT Coordination Center, VU#506989. Section referenced: publicly referred to as both HiveNightmare and SeriousSAM in Description. ↩

  7. Microsoft Security Response Center, machine-readable data for CVE-2021-36934. Section referenced: the revisions array. Revision 3 (July 23, 2021, removed Server Core of Windows Server, version 20H2), revision 4 (July 27, 2021, Removed Windows Server versions from the Security Updates table as they are not affected), and revision 5 (August 10, 2021, releasing the August 2021 security updates). ↩ ↩2 ↩3

  8. CERT Coordination Center, VU#506989. Sections referenced: in Description, the BUILTIN\Users group is given RX permissions, If a VSS shadow copy of the system drive is available and the following list of impacts (Extract and leverage account password hashes, Discover the original Windows installation password, Obtain DPAPI computer keys, Obtain a computer machine account, which can be used in a silver ticket attack), and larger that 128GB in size and then performing a Windows Update or installing an MSI. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9

  9. CISA, official JSON of the Known Exploited Vulnerabilities Catalog. Sections referenced: in the element whose cveID is CVE-2021-36934, vulnerabilityName (Microsoft Windows SAM Local Privilege Escalation Vulnerability), dateAdded (2022-02-10), and If a Volume Shadow Copy (VSS) shadow copy of the system drive is available, users can read the SAM file in shortDescription. ↩ ↩2 ↩3

  10. Microsoft Security Response Center, machine-readable data on the products affected by CVE-2021-36934. Sections referenced: product in each element, and articleName and fixedBuildNumber in kbArticles. Each version has 32-bit, ARM64 and x64 entries, and in the list as of the check date the x64 entry for version 20H2 could not be found. The article summarizes them by version. ↩ ↩2 ↩3

  11. Microsoft Learn, System Restore points are disabled after you upgrade to Windows 10. Section referenced: if the size of the operating system disk is greater than 128 gigabytes (GB), a restore point is automatically created in More information. CERT/CC’s explanation also refers to this article. ↩

  12. CERT Coordination Center, VU#506989. Sections referenced: in Description, To check if a system is vulnerable, the following command can be used from a non-privileged command prompt, A vulnerable system will report BUILTIN\Users:(I)(RX), and A system that is not vulnerable will report output like this (Access is denied.). ↩ ↩2 ↩3

  13. Microsoft Learn, icacls. Sections referenced: (I) - Inherit. ACE inherited from the parent container and RX - Read and execute access in Remarks. ↩

  14. Microsoft Learn, Volume Shadow Copy Service (VSS). Sections referenced: search term a consistent shadow copy (also known as a snapshot or a point-in-time copy), System Restore among the uses, and Shadow copies are read-only. ↩ ↩2 ↩3

  15. Microsoft Support, KB5005357: Delete Volume Shadow Copies. Sections referenced: in What are Volume Shadow Copies and where are they used?, read and backup locked or running files, you will lose access to the previous restore points if Volume Shadow Copies are deleted, and If you are using a backup application that creates a backup outside of Volume Shadow Copy, you should not be affected. ↩ ↩2

  16. The last sentence of this paragraph was assembled from CERT/CC and CISA listing the presence of shadow copies as a condition for exploitation, from the explanation in Registry Hives that hive files are loaded at startup, and from read and backup locked or running files in KB5005357. Microsoft’s documents do not explicitly state why the live files could not be read directly. ↩

  17. CERT Coordination Center, VU#506989. Section referenced: Newly-created shadow copies, which will contain the proper ACLs, will function as expected in Solution. ↩ ↩2 ↩3

  18. Microsoft Security Response Center, machine-readable data for CVE-2021-36934. Section referenced: FAQ in the articles array. Search terms To avoid deleting data without users' consent and does not correct the ACLs on every file in %windir%\system32\config. ↩ ↩2 ↩3 ↩4

  19. Microsoft Learn, What is Windows LAPS?. Sections referenced: Local administrator accounts often share the same password across many devices, which bad actors can exploit to move laterally at the beginning, and Protection against pass-the-hash and lateral-traversal attacks in Benefits. ↩ ↩2 ↩3 ↩4 ↩5

  20. This sentence was assembled from Extract and leverage account password hashes listed by CERT/CC, and from Local administrator accounts often share the same password across many devices in the Windows LAPS overview. The CVE-2021-36934 advisory does not explicitly mention lateral movement. ↩

  21. Microsoft Security Response Center, machine-readable data for CVE-2021-36934. Section referenced: Workaround in the articles array. Search terms Restrict access to the contents of %windir%\system32\config, icacls %windir%\system32\config\*.* /inheritance:e, You must restrict access and delete shadow copies, Even after installing this security update, you must delete all shadow copies of your system volume in Note 2, and restore data with third-party backup applications and Restoring your system from a backup could also restore the overly permissive ACLs in Impact of workaround. ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  22. Microsoft Support, KB5005357. Sections referenced: vssadmin list shadows /for=%systemdrive% in How can I view the current Volume Shadow Copies, and vssadmin delete shadows /for=%systemdrive% /Quiet and No items found that satisfy the query. in How can I delete Volume Shadow Copies?. ↩ ↩2 ↩3

  23. Microsoft Learn, vssadmin delete shadows. Sections referenced: You can only delete shadow copies with the client-accessible type at the beginning, Use the diskshadow command instead, and the note Deleting a shadow copy is permanent in Examples. ↩ ↩2

  24. Microsoft Support, KB5005357. Sections referenced: Checkpoint-Computer in What is the process to create a new System Restore Point?, and you will need to address the vulnerability or issue before creating a new System Restore Point or backup. ↩ ↩2

  25. Microsoft Support, KB5005357. Section referenced: Volume Shadow Copies created by wbadmin must be managed within that application in Why am I not able to delete all Volume Shadow Copies on my Windows Server device?. ↩

Recent articles sharing the same tags. Deepen your understanding with closely related topics.

These are topic pages close to this theme. Starting from the article, you can go on to related services and other articles.

This article leads to the following service pages. Start from the entry point closest to your situation.

Frequently Asked Questions

Questions commonly asked at the time of consultation about the topic of this article.

Is installing the August 2021 security update enough to deal with HiveNightmare?
No. Microsoft states explicitly that the vulnerability is not fully mitigated unless all shadow copies of the system volume are deleted manually after installing the update. The update fixes the permissions of the live files; the contents of shadow copies created before it do not change.

References

What stops working when the shadow copies are deleted?
Restore points that depend on the deleted shadow copies can no longer be used. Microsoft says this may also affect restores with third-party backup applications. On the other hand, it explains that backup applications that create backups without using shadow copies are not affected.

References

How can I check whether my PC is in an affected state?
Run icacls %windir%\system32\config\sam from a command prompt that is not elevated. According to CERT/CC, an affected system includes BUILTIN\Users:(I)(RX) in the output; otherwise, access is denied. To check whether shadow copies exist, run vssadmin list shadows from an elevated command prompt.

References

Is Windows Server affected too?
Microsoft's updates cover Windows 10 versions 1809 through 21H1 and do not include Windows Server. In revisions after publication, the Windows Server versions were removed from the list as not affected.

References

Author Profile

Profile page for the article author.

Go Komura

Representative of KomuraSoft LLC

Focused on Windows software development, technical consulting, and bug investigation, with particular strength in projects where existing assets remain and in investigating failures whose cause is hard to see.

Back to the Blog