Reversing Pulse Secure Client Credentials Store
The Pulse Secure VPN client stored saved credentials encrypted with Windows DPAPI using a predictable entropy value derived from the registry key name, which any local user could read. An attacker with access to a user's session could decrypt the stored domain password in plaintext.
gremwell.com
Published on gremwell.com
In early 2019, I had to assess the latest version (9.1r3 at the time) of Pulse Secure Connect Client, an IPSEC/SSL VPN client developed by Juniper.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used a predictable value (the registry key name) as the optional entropy for DPAPI encryption, making the encryption effectively reversible by any user who can read the registry.
Impact
An attacker with local access to a user's session could recover the saved domain password in plaintext without any privilege escalation.
What the attacker needed
Local access to the user's session; saved credentials in Pulse Secure client
The fix
The issue was fixed in version 9.1R4 by moving the DPAPI encryption to a service running as SYSTEM and using a hardcoded entropy value, so that decryption requires SYSTEM privileges.
How it was found
- Use procmon to find that CryptProtectData is called before saving credentials to the registry.
- Disassemble the client to confirm it uses DPAPI and identify the entropy parameter.
- Attach a debugger to the running process and set breakpoints on CryptProtectData and CryptUnprotectData.
- Trigger a credential save and inspect the function arguments to see the plaintext password and the entropy value.
- Note that the entropy value matches the registry key name (uppercased, dashes removed).
- Write a script that reads the encrypted registry value and decrypts it using the derived entropy.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you tick 'save password' in some apps, the password is scrambled so it can't be read easily. Here, the scrambling used a 'key' that was just the name of the storage folder, which any user can see. So anyone who could run a program on the computer could unscramble and read the saved password.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.