今日已更新 62 条资讯 | 累计 42120 条内容
关于我们

How Selenium + Chrome Locked Me Out of My Own Windows Account

Bill Gates 2026年09月11日 23:32 1 次阅读 来源:Dev.to

I ran into one of those "bugs" that initially looks completely unrelated to your code. My Windows account started getting locked randomly. The weird part was that I knew the password was correct. Sometimes I could log in normally, and sometimes Windows would suddenly say that the account was locked. At first I assumed it was some Windows issue. It wasn't. The clue: Event ID 4625 After checking the Windows Security event log, I found a large number of failed logon events: Event ID : 4625 TargetUserName : John Doe LogonType : 2 SubStatus : 0xc000006a ProcessName : C: \P rogram Files \G oogle \C hrome \A pplication \c hrome.exe 0xc000006a means that the authentication attempt failed because of an incorrect password. But the interesting part was this: ProcessName: chrome.exe Chrome was generating failed Windows authentication attempts. And then I remembered what I was doing immediately after logging in: running a Selenium application that starts multiple Chrome instances in parallel. What was actually happening By default, ChromeDriver creates a temporary Chrome profile for a Selenium session. Chrome has Windows-specific logic that may check the current user's authentication state. One of those checks can call the Windows LogonUser API using an empty password. DWORD logon_result = LogonUser ( username , L"." , L"" , LOGON32_LOGON_INTERACTIVE , LOGON32_PROVIDER_DEFAULT , & handle ); For a Windows account with a real password, that authentication attempt fails. Normally this is mostly harmless. But my application was creating many independent Chrome instances. So effectively I had something like this: Start Selenium -> Create many ChromeDriver instances -> Create many fresh Chrome profiles -> Chrome performs Windows authentication checks -> Create many fresh Chrome profiles -> Chrome performs Windows authentication checks -> Windows records multiple failed logon attempts -> Account lockout threshold is reached So the funniest part of the bug was that my actual password wa

本文内容来源于互联网,版权归原作者所有
查看原文