Commit 14b40fd
committed
fix(windows): pin the Node runtime so validators cannot be redirected
Get-DreamSkinNodeRuntime accepted $env:CODEX_DREAM_SKIN_NODE and, failing
that, whatever node.exe PATH resolved to. Get-DreamSkinValidatedNodeRuntime
then 'validated' the candidate by running `node -p process.versions.node` --
so a hostile binary executed before any check ran. Validation was execution.
That runtime runs every validator this project owns: Safe CSS
(theme-windows.ps1:293), the theme package validator (:1038), image metadata
limits (:246) and the injector (:1269). Anyone able to write HKCU\Environment
-- no admin rights required -- could point all four at their own node.exe and
bypass them at once, including the Safe CSS allowlist that community themes
are gated on.
macOS never had this: require_signed_node_runtime pins the path inside the
ChatGPT bundle, codesigns it and compares team IDs, with no env override.
This closes the asymmetry.
- Pin to the engine's bundled runtime\node\node.exe, which the installer
stages and the engine manifest hash-verifies. No env override, no PATH.
- Add Assert-DreamSkinTrustedNodeImage, called before the first execution:
Authenticode status must be Valid and the signer must be OpenJS/Node.js
Foundation or Microsoft.
- run-tests.ps1 asserted the env var was present, pinning the unsafe shape in
place -- same trap as the -32000 readiness test. It now asserts the opposite,
plus that no PATH fallback exists and that the signature check precedes the
probe. Verified by injection: each regression flips its assertion red.1 parent 3aaaf7d commit 14b40fd
2 files changed
Lines changed: 49 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
422 | 438 | | |
423 | 439 | | |
424 | 440 | | |
| |||
428 | 444 | | |
429 | 445 | | |
430 | 446 | | |
| 447 | + | |
431 | 448 | | |
432 | 449 | | |
433 | 450 | | |
| |||
446 | 463 | | |
447 | 464 | | |
448 | 465 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
453 | 474 | | |
454 | 475 | | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
| 476 | + | |
| 477 | + | |
463 | 478 | | |
464 | | - | |
| 479 | + | |
465 | 480 | | |
466 | 481 | | |
467 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | 178 | | |
180 | 179 | | |
181 | 180 | | |
182 | | - | |
| 181 | + | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
188 | 207 | | |
189 | 208 | | |
190 | 209 | | |
| |||
0 commit comments