AIStudio2API
AIStudio2API copied to clipboard
[Bug] Windows Chrome import trusts HKCU App Paths\chrome.exe without verifying Google Chrome, breaking ABE decryption (ERR decrypt)
发生了什么 / What happened
Summary
On Windows, findChromeExecutable() checks HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe first and accepts any existing file without checking whether it is official Google Chrome. When another Chromium-based browser (e.g., CentBrowser) registers HKCU\...\App Paths\chrome.exe, aistudio2api launches that third-party chrome.exe and injects abe_helper_amd64.dll into it, causing GoogleChromeElevationService (IElevator2) to reject DecryptData (ERR decrypt) even when official Google Chrome is installed in Program Files.
Reproduction
- Have official Google Chrome installed (with profiles under
%LOCALAPPDATA%\Google\Chrome\User Data) and another Chromium browser that wroteHKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exepointing to its own binary. - Run Chrome import from the UI or
setup. retrieveV20KeyreadsLocal Statefrom%LOCALAPPDATA%\Google\Chrome\User Data, thenfindChromeExecutable()resolvesHKCU\...\App Paths\chrome.exe(the non-Google binary).decryptAppBoundCiphertextlaunches the wrongchrome.exe,abe_helper.ccallsDecryptData, andGoogleChromeElevationServicerejects it because the calling process path/signature does not match Google Chrome, returningERR decrypt.
Root Cause Pointers
internal/chromeauth/abe_windows_amd64.go(findChromeExecutable,chromeExecutableFromRegistry):- Iterates
registry.CURRENT_USERbeforeregistry.LOCAL_MACHINEandchromeExecutableFallbacks(). - Only validates
!fileInfo.IsDir(), without checking that the binary belongs to Google Chrome (e.g., company/product version info or Authenticode/path check) or matchingchromeRoot.
- Iterates
internal/chromeauth/native/abe_helper.c(call_decrypt/worker):- Discards both
HRESULTandlast_errorwhenDecryptDatafails, returning only"ERR decrypt", which hides0x8004A007/ERROR_GEN_FAILUREdiagnostics.
- Discards both
Suggested Fix
- Verify that any registry-discovered
chrome.exeis actually Google Chrome (or fall back to the next candidate /Program Files\Google\Chrome\Application\chrome.exewhenHKCUpoints to a non-Google executable). - Include
hr(andlast_error) inabe_helper.c's error string whenDecryptDatafails so Windows ABE errors are immediately diagnosable.
版本 / Version
No response