Back to Blog
Red Teaming Aug 27, 2026 218 views

WDigest Credential Caching: How the Technique Works and How to Mitigate It

With local admin or SYSTEM on a Windows host, an attacker can flip one registry value to make WDigest cache passwords in plaintext. Full attack walkthrough, detection, and mitigation (part 1 of our credential protection series).

By Obaida Albasha, Security Researcher, Cytomate

Part 1 of our Windows Credential Protection series: what breaks when a control is off, how an attacker abuses that gap, and how to turn it on and keep it on.

Most credential-theft stories on Windows end with a hash

An attacker pulls an NTLM hash out of LSASS, replays it with Pass-the-Hash, and moves along. Hashes are useful, but they have a ceiling: you can't type a hash into a VPN portal or an Outlook login. A password goes everywhere a hash can't.

WDigest is the component that has long let attackers get from one to the other. It is an old authentication provider that almost nobody needs anymore, yet with the right privileges you can tell it to start keeping passwords in plaintext in memory. One registry value: that is the whole trick. Public guidance now treats the setting as deprecated on the newest Windows (there's a section on that further down), but across the mixed estates that exist in the real world the technique is still very much live. So this post does two things: it shows exactly how the attack works, and it lays out how to mitigate it in practice.

What WDigest is

WDigest, short for Windows Digest Authentication, is a Security Support Provider that loads inside LSASS, the process that handles logons on every Windows box. Microsoft shipped it back in the Windows XP and Server 2003 era to support HTTP Digest and SASL authentication, the sort of thing early web and LDAP deployments leaned on (RFC 2617 and 2831, if you want the detail).

To answer a digest challenge, WDigest needs the user's actual password, not a hash. So it kept one in memory in a form it could reverse. That was an acceptable trade in 2003. It became a liability the moment credential-dumping tools got good, because anything that can read LSASS can read that password. That is why plaintext caching has been off by default since Windows 8.1 and Server 2012 R2. The lever that turns it back on lives at a single registry value, which is exactly what attackers reach for.

Everything hinges on one key

HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest
    UseLogonCredential  (REG_DWORD)
Value What WDigest does
1Keeps a plaintext copy of credentials in memory
0 or missingDoes not (the modern default)

There is no exploit here, no memory corruption, nothing clever. If you can write to that key, you can turn plaintext caching back on. The catch, and the reason this is a post-exploitation move rather than a way in, is that writing to it needs local admin or SYSTEM. You have to already be inside. MITRE files it under T1112 (Modify Registry) feeding T1003.001 (LSASS Memory), and that pairing tells the whole story: change a setting, then read what falls out of it.

A demonstration in a small lab domain

Everything below runs in CYTOMATE.LOCAL, a lab we own. The account is a domain user called obaida, and every command runs from an elevated prompt.

1. The baseline: establish what is already in memory

Before touching anything, dump LSASS with Mimikatz to see what is already there. privilege::debug grabs the debug privilege so Mimikatz can read the process; sekurlsa::logonpasswords walks the cached logon sessions.

Scroll to the wdigest block and the password field reads (null). That is exactly what a healthy install should show. The NTLM hash is present, but there is no plaintext to be had. Right now the attacker is stuck with a hash.

mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"
Mimikatz run against LSASS establishing a baseline
Figure 1. Running Mimikatz against LSASS to establish a baseline.
Default state: NTLM hash present, plaintext password null
Figure 2. Default state: the hash is there, the plaintext password is not.

2. Flip the switch: enable plaintext caching with one registry write

This is the entire technique: one registry write. Here is the part that trips people up: the change only affects logons that happen after it. The credentials already sitting in memory will not suddenly turn into plaintext. WDigest fills in the plaintext copy the next time someone authenticates. So the attacker waits, or gives it a nudge with a runas, an RDP session, or by bouncing a service.

reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f
Setting UseLogonCredential to 1
Figure 3. Setting UseLogonCredential to 1.

3. Collect the password: same account, same session, now in the clear

Once obaida logs in again, dump LSASS a second time. On a vulnerable build, this run tells a different story.

The hash became a password. If obaida were a domain admin instead of an ordinary user, that is a fully usable admin credential you can type in anywhere, not just a hash to replay against NTLM services.

wdigest :
 * Username : obaida
 * Domain   : CYTOMATE
 * Password : Sup3r$ecur3P@ssw0rd_
The password now sitting in cleartext in LSASS
Figure 4. Same account, same session, and the password is now sitting in the clear.

4. Put the key back: a careful attacker reverts the change

A careful attacker reverts the change afterwards to keep the footprint small. The password is already gone, so reverting costs the attacker nothing.

reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 0 /f
Reverting UseLogonCredential to 0
Figure 5. Reverting the value to 0 after the password is captured.

It matters for you, though: if your only check is “what does the value say right now,” a reverted key looks spotless. You will never know it was flipped unless you were watching the change itself. Hold that thought: it shapes the whole detection section.

A hash and a password are not the same currency

If you have popped a box and dumped LSASS, you already have NTLM hashes. So why is enabling WDigest worth the extra step? Because a hash gets you Pass-the-Hash against services that accept NTLM, which is a lot of internal Windows infrastructure and genuinely powerful. What it will not do is log you into OWA, the VPN portal, the corporate SSO page, or the internal web app the finance team lives in. Those want a password, typed the way a person would type it.

A plaintext password works in all of those places. It also tends to unlock far more than the machine you found it on, because people reuse passwords across systems that have nothing to do with each other, and they always will.

It is patient, too. The attacker does not need to catch a privileged account that is already logged in. Flip the switch on a machine, then wait for the next domain admin to run a scheduled task, remote in for maintenance, or start an install. Whoever authenticates next hands over their password in the clear.

The version that skips the registry

Worth knowing, because it changes how you detect this. The value is really just backing a variable inside wdigest.dll called g_fParameter_UseLogonCredential. Researchers have shown you can flip that variable directly in LSASS memory and skip the registry entirely (bordergate has a write-up). It is more involved, since you first have to get past the Protected Process Light guard on LSASS, usually by loading a vulnerable signed driver. But the consequence is what counts: no registry write means no registry event, and it sidesteps policy that only pins the registry value.

We are not publishing that tooling here. The defensive takeaway is simple: registry monitoring is necessary but not sufficient. You also need eyes on who is touching LSASS and what drivers are loading.

This shows up in two places: the config change and the LSASS read

Watch both. A reverted key looks clean at rest, so detection has to catch the change as it happens and the memory read that follows.

EVENT ID 4657

The registry change

Windows can log a change to the WDigest key as event 4657, but not out of the box. Enable Audit Registry under Object Access, then put a SACL on the key itself (Permissions → Advanced → Auditing → add a principal auditing Set Value). The event then hands you the account, the process, and both old and new data. TrickBot and several ransomware crews have flipped this exact key.

SYSMON 12 / 13 / 14

Sysmon, if SACLs are a headache

Managing SACLs across a fleet gets old fast. Sysmon's RegistryEvent records catch the same change without per-key auditing. There are ready-made rules for it: SigmaHQ ships one, and Splunk's security content has a detection keyed on the value being set to 1.

SYSMON EVENT ID 10

Watch LSASS itself

Enabling WDigest is pointless unless the attacker comes back to read LSASS. Sysmon event 10 logs any process opening a handle to lsass.exe. A handle asking for memory-read rights (0x0010) or full control (0x1FFFFF) from something that is not a known Windows component is a strong signal, and it catches the memory-only variant too.

EVENT 4688 / 4104 · 4624 / 4776

Command lines, then connect the dots

Process-creation logging shows the literal reg add … UseLogonCredential … 1. PowerShell script-block logging (4104) picks up Set-ItemProperty against the same path. Then tie a UseLogonCredential=1 change to the logons that follow (4624 on host, 4776 on the DC) where the auth package is WDigest.

Make sure there is no plaintext to steal, and make any attempt to change that loud

Do all of these, not just one. Enforcement without detection is brittle; detection without enforcement is just noise.

  1. Enforce the value, don't just set it. Setting UseLogonCredential to 0 by hand does not help much against an attacker with admin rights who can set it straight back. Push it through Group Policy so it re-applies on every refresh: Computer Configuration → Preferences → Windows Settings → Registry, delivering UseLogonCredential = 0. On anything as old as Windows 7 or Server 2008 R2, install KB2871997 first. The nice side effect: if an attacker flips the key, GPO reverts it at the next refresh, and if 4657 auditing is on, you caught the attempt before it was undone.
    # expect 0, or no value at all
    (Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -EA SilentlyContinue).UseLogonCredential
  2. Lock down LSASS with PPL. Run LSASS as a Protected Process Light so ordinary tools cannot open a read handle to it. Getting past PPL means loading a vulnerable driver from kernel mode, which is noisy in its own right and worth alerting on. RTCore64.sys, DBUtil_2_3.sys and iqvw64e.sys are the usual suspects.
    HKLM\SYSTEM\CurrentControlSet\Control\Lsa
        RunAsPPL  (REG_DWORD) = 1
  3. Turn on Credential Guard. On supported Windows 10/11 Enterprise and Server builds, Credential Guard moves secrets (WDigest material included) into a virtualization-based-security container that user-mode tools like Mimikatz simply cannot reach. On a lot of recent Windows 11 and Server 2025 builds it is already on by default. It is the strongest single control here, even if WDigest is re-enabled, there is no reachable plaintext to pull. One caveat: it is an Enterprise and Education feature, so Windows 11 Pro machines without it stay more exposed if a legacy app ever forces WDigest back into play.
  4. Shrink the blast radius. This is a post-exploitation technique, so limit who can pull it off and what a stolen password is worth. Tier your admin accounts so domain admins never log on to the workstations where their credentials could be harvested. Add high-value accounts to the Protected Users group, which blocks WDigest caching (and other weak methods) for its members outright. Use jump hosts and privileged access workstations, LAPS for local admin, and just-in-time elevation so there are no standing privileged sessions sitting in memory. Put MFA in front of the identity surfaces (VPN, webmail, SSO) so a bare password buys the attacker less than it used to.
  5. Prove it actually works. Configuration drifts and detection rules rot. The only way to know your GPO is holding and your 4657 alert fires is to run the technique on purpose, on a schedule, and confirm that prevention and detection both do their job. That is exactly what breach and attack simulation is for: flip the key in a controlled test, watch what your stack does or does not catch, and close the gaps before someone else finds them.

What public guidance says about Windows 11 and Server 2025

It is worth being clear about the state of WDigest on current Windows, because the public record has moved. Microsoft deprecated the WDigest plaintext setting starting with Windows 11 24H2 and removed the policy from the Windows 11 25H2 security baseline, describing it as no longer necessary. In the Microsoft Q&A thread on the subject, the guidance is that plaintext may not be stored at all on Windows 11 25H2 even with UseLogonCredential=1, thanks to that deprecation and the hardening around it. Several write-ups describe WDigest plaintext caching as effectively dead on Windows 11 and Windows Server 2025.

Treat that as good news, not a reason to relax. “Effectively dead on a fully patched, hardened build” still leaves the older, unpatched, and un-Credential-Guarded machines that exist in every real network, and those are exactly where a domain admin credential is worth the most. The mitigations above are what make the technique irrelevant everywhere, rather than just on your newest boxes. Verify the state per host instead of trusting a global assumption, and keep the detection in place regardless.

The short version

WDigest is a textbook example of legacy debt turning into a security liability: one registry value and a set of admin rights away from turning every future login into a plaintext password. Public guidance now treats the plaintext capability as deprecated on Windows 11 and Server 2025, but the technique still works across the mixed estates that make up most environments. The fix is not complicated. Enforce the value in policy, turn on PPL and Credential Guard, add sensitive accounts to Protected Users, watch the key and watch LSASS, and test that all of it holds. Do that, and the switch stops mattering.

Coming up in this series

WDigest was the opener. Each post that follows takes a single Windows credential-protection control and runs it through the same lens: what breaks when it is off, exactly how an attacker abuses that gap, and how to turn the control on and keep it on, each with its own lab walkthrough and detections.

  1. Credential Guard: What VBS actually protects, what happens when it is disabled, and how to enable and verify it without breaking legacy apps.
  2. LSA Protection (RunAsPPL): Running LSASS as a Protected Process Light, the driver-loading bypasses that defeat it, and how to catch them.
  3. Protected Users & tiering: Blocking WDigest, NTLM, and delegation for sensitive accounts, and building an admin tier model that holds.
  4. LAPS & local admin: Killing password reuse on local administrator accounts and why it collapses lateral movement.
  5. Cached logons & DCSync: MSCache/DCC2 exposure, replication-rights abuse, and locking down the last credential stores.
  6. Kerberoasting & delegation: Weak service-account secrets and unconstrained delegation, from the offensive test to the hardening.

Sources & Further Reading Microsoft, Windows 11, version 25H2 security baseline (WDigest policy removed)
Microsoft Q&A, Enable WDigest doesn't work on Windows 11
Netwrix, WDigest Clear-Text Passwords: Stealing More than a Hash
bordergate, WDigest Authentication (memory-patching variant)
The Hacker Recipes, Mimikatz · sekurlsa::wdigest
MITRE ATT&CK: T1003.001 (OS Credential Dumping: LSASS Memory) and T1112 (Modify Registry)
Microsoft: Security Advisory KB2871997, Windows Defender Credential Guard, and Protected Users group documentation
SigmaHQ and Splunk Security Content: detection rules for UseLogonCredential set to 1
Microsoft Sysinternals: Sysmon (registry and LSASS-access telemetry)

Everything shown here was performed in an isolated lab we own, for defensive research and authorised testing. Don't run it anywhere you don't have explicit permission to.

More from the Blog

Threat Intelligence Nov 29, 2026

The Build-Pipeline Backdoor: Inside the NullReceiver Supply-Chain Campaign

Read More
Deception Nov 29, 2026

Lying to the Machines: The Secret Weapon Against AI Attacks

Read More
Agentic Security Nov 24, 2026

Your AI Coding Agents Need an EDR Too: Introducing cADRe

Read More