[Windows] `kimi web` exits with 0xC0000409 (FAST_FAIL_STACK_COOKIE_CHECK_FAILURE) — bundled Node 24.15.0 carries the known libuv RtlGetVersion stack overflow
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Read .nvmrc and .github/workflows/_native-build.yml to confirm which Node version the native build embeds. Check the referenced upstream Node and libuv fixes, then update the runtime version so Windows binaries include the fix. Done when the native build uses a fixed Node release and the reported Windows crash no longer reproduces.
Written by the indexing model from the issue text.
Description
What version of Kimi Code is running?
2.5.2 (native Windows binary, FileVersion 24.15.0, i.e. the bundled Node runtime)
Note: this is not fixed on the current latest. .nvmrc is still 24.15.0 on main and on tag @moonshot-ai/[email protected], and .github/workflows/_native-build.yml builds the SEA with node-version-file: .nvmrc, so every shipped Windows binary carries the vulnerable runtime.
Which open platform/subscription were you using?
kimi-for-coding (managed:kimi-code). The crash is provider-independent — it also happens with a custom OpenAI-compatible provider, because it is in the TCP connect path, not in the model request path.
Which model were you using?
deepseek-v4.1-flash via a custom OpenAI-compatible provider (also reproduced with kimi-for-coding).
What platform is your computer?
Microsoft Windows NT 10.0.26300.0 x64 (Windows 11, build 26300)
What issue are you seeing?
kimi web on Windows dies silently after anywhere from a few minutes to a few hours of normal use:
- no JS error, no stack trace, no log line in
--log-level infooutput - no Windows Error Reporting entry (the process is killed by a fail-fast, so WER never runs)
- the only trace is the process exit code
exit code 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN)
ExceptionCode 0xC0000409
ExceptionInformation[0] = 0x2 (FAST_FAIL_STACK_COOKIE_CHECK_FAILURE)
Faulting address: kimi.exe+0x21F2189 (__report_gsfailure, int 0x29)
Observed crashes on one machine (2026-11-13), all started with kimi web --port 5090 --host --log-level info:
| started | died | exit code |
|---|---|---|
| 21:10:37 (official 2.5.2 binary, launched under procdump) | 21:50:34 | 0xC0000409 |
| 22:35:35 (2.5.2 from source, Node 24.15.0) | 23:31:44 | 0xC0000409 |
| 23:36:46 (same) | 23:44:22 | 0xC0000409 |
This has been happening consistently for weeks, on both the TUI and kimi web.
What steps can reproduce the bug?
In production it is probabilistic: just run the server and use it normally (the web UI, long sessions, tool calls). It correlates with number of outbound TCP connects, not with any particular request — every connect calls into the vulnerable code path.
The upstream libuv issue (libuv/libuv#5394) has a deterministic reproducer; it crashed 32/80 rounds on Node v24.15.0 on the reporter's machine. On my machine I could not make it fire in 70 runs of that same script — the trigger depends on what value happens to be left in one uninitialized stack slot, so the rate varies by machine/build — but the crash dumps prove the mechanism below.
// repro.mjs — from libuv/libuv#5394
import { createServer } from "node:http";
for (let i = 0; i < 84; i++) {
const server = createServer((req, res) => {
req.on("data", () => {});
req.on("end", () => {
res.writeHead(200, { "Content-Type": "application/json; charset=utf-8" });
res.end("{}");
});
});
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
const port = server.address().port;
const res = await fetch(`http://127.0.0.1:${port}/x`, {
signal: AbortSignal.timeout(30000),
});
await res.text();
await new Promise((resolve, reject) => server.close((e) => (e ? reject(e) : resolve())));
}
for ($r = 1; $r -le 80; $r++) {
node repro.mjs 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) { "round $r crashed: 0x{0:x8}" -f ($LASTEXITCODE -band 0xFFFFFFFFL) }
}
What is the expected behavior?
The server process stays up. If it must fail, it should log something actionable instead of vanishing.
Additional information
Full root cause, confirmed from a procdump -e -ma full-memory dump of the crash:
The crash is a stack-buffer overflow inside libuv, not in kimi code.
-
In
deps/uv/src/win/tcp.c,uv__is_fast_loopback_fail_supported()(renameduv__windows10_version1709()in libuv 1.52) does:OSVERSIONINFOW os_info; /* 276 bytes, dwOSVersionInfoSize NOT initialized */ if (!pRtlGetVersion) return 0; pRtlGetVersion(&os_info); -
ntdll!RtlGetVersionbranches on the (uninitialized)dwOSVersionInfoSize. If that field happens to equal0x11c(284,sizeof(RTL_OSVERSIONINFOEXW)), it takes the "EX" path and writes 284 bytes into the 276-byteOSVERSIONINFOW. -
In the clang-cl-built Node 24.15.0 frame for
uv__tcp_try_connect,os_infosits at[rsp+0xd4]and ends at exactly[rsp+0x1e8]— which is the compiler's/GScookie slot. The 8 extra bytes land on the cookie:[rsp+0x1e8] = 0x0001010000000000 ^^ ServicePackMajor = 0 ^^ ServicePackMinor = 0 ^^ SuiteMask = 0x0100 ^^ ProductType = 1 (VER_NT_WORKSTATION) -
The function returns through
__security_check_cookie, the check fails, and__report_gsfailurecalls__fastfail(FAST_FAIL_STACK_COOKIE_CHECK_FAILURE)→0xC0000409. No handler can run; the process is gone. -
I reproduced step 2 in isolation (call
RtlGetVersionon a 276-byte buffer withdwOSVersionInfoSize = 0x11c): the 8 bytes after the buffer become00 00 00 00 00 01 01 xx, exactly the value found in the cookie slot in the dump. -
Symbolized stack from the dump (with the published
node.pdbfor v24.15.0):__report_gsfailure @ .../vcstartup/src/gs/gs_report.c:220 uv__tcp_try_connect @ deps/uv/src/win/tcp.c uv_tcp_connect @ deps/uv/src/uv-common.c:411 node::MakeLibuvRequestCallback<uv_connect_t,...> @ src/req_wrap-inl.h:126 node::TCPWrap::Connect @ src/tcp_wrap.cc:469 ... v8 FunctionCallback ... -
Fixed upstream in libuv by initializing the struct — libuv/libuv#5107 (
os_info.dwOSVersionInfoSize = sizeof(os_info); os_info.szCSDVersion[0] = L'\0';), cherry-picked into Node via nodejs/node#62561. It is present from Node v24.16.0 onward. I verifieddeps/uv/src/win/tcp.cper tag:Node libuv struct initialized kimi ships it v24.15.0 1.51.0 no yes (2.5.2 … 2.6.3) v24.20.0 / v24.21.0 / v24.22.0 1.52.1 yes no v26.13.1 1.52.1 yes no (Node v26.0.0 is also unfixed; the fix landed in 26.5.0. v22.x is latent-but-unobservable because its MSVC frame has a gap before the cookie.)
-
Because the vulnerable probe runs on every
uv_tcp_connect, the rate scales with how many connections the process makes — which is why long-runningkimi websessions with remote UI clients die and short ones usually do not.
Suggested fix: bump .nvmrc to a Node that carries the fix (v24.16.0+, e.g. the latest 24.x LTS line) so the native SEA build embeds a fixed libuv. package.json has engines.node >= 24.15.0, so this needs no other change.
User-side workaround until then: run from source with Node >= 24.16.0 (pnpm dev:server / node --import tsx ./src/main.ts web ...), which is unfixed at 24.15.0 and clean at 24.21.0.
Upstream references:
- libuv/libuv#5394 — deterministic reproducer + per-version crash rates (open)
- libuv/libuv#5107 — the fix (merged)
- nodejs/node#62561 — cherry-pick into Node (v24.16.0)
- Dominant language
- TypeScript
- Stars
- 8.3k
- Forks
- 1.4k
- Avg merge
- 12h 6m
- Merged PRs (30d)
- 596
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MoonshotAI/kimi-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MoonshotAI/kimi-code#5539 ·
Maintainers usually reply within 1 day
-
[Bug] Kimi RC workspace folder picker does not display symbolic link directoriesPossibly taken @markankamaransheogarat-sys claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MoonshotAI/kimi-code#5296 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MoonshotAI/kimi-code#5256 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MoonshotAI/kimi-code#5062 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
MoonshotAI/kimi-code#5025 ·
Maintainers usually reply within 1 day
All issues in MoonshotAI/kimi-code
Similar issues
-
Add Alice&BotOpen
Difficulty 1/5 Under an hour Newbie friendliness 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
midnightntwrk/midnight-faucet-api#215 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NanmiCoder/cc-haha#2034 · 1 comment ·
Maintainers usually reply within 1 day
-
mobile prio:low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
digitalfabrik/entitlementcard#3324 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day