atom / node-keytar

Native Password Node Module
https://atom.github.io/node-keytar
MIT License
1.37k stars 193 forks source link

[Windows] Old credential comes back after current one is deleted #455

Open xsq007 opened 2 years ago

xsq007 commented 2 years ago

Prerequisites

Description

A value was set for some service/account for keytar 4.x. Then migrate keytar to 7.x and set another value for same service/account. Delete this service/account and the old value set in keytar-4.x came back after rebooting the computer.

Steps to Reproduce

  1. npm i keytar@^4
  2. keytar.setPassword('service', 'account', '1')
  3. npm i keytar@^7
  4. keytar.setPassword('service', 'account', '2')
  5. keytar.deletePassword('service', 'account')
  6. reboot computer
  7. Check Windows Credential Manager and service/account credential still exists and its value is 1.

Expected behavior: There should be no service/account credential in Windows Credential Manager after calling deletePassword.

Actual behavior: The old one set in keytar-4.x came back.

Reproduces how often: Every time

Versions

Additional Information

Nantris commented 2 years ago

Windows version?

glenn2223 commented 1 year ago

Just an FYI

Mailspring uses keytar and there are various reports of issues with passwords, i.e. being old or reset to a previous one. https://community.getmailspring.com/search?q=password%20%23bugs

Most seem to be related to Windows OS

Nantris commented 1 year ago

If anyone is using key-tar in Electron; Electron has its own similar mechanism now. I forget the name though.