xcl run: the title no longer inherits the PC's environment, so dumps carry no secrets (#702) #740

Open
github-bot wants to merge 2 commits from github-bot/gh-740 into main AGit
Owner

@⁠dadnotdaddy on GitHub · 2026-11-24 04:21 UTC · original
dadnotdaddy:fix-702 → main · +68 −0 · 2 files · 2 commits · open

Fixes #702: the title runs in xcl.exe's process and inherited the PC's whole environment, so its crash dumps carried any tokens or keys set there. Before the entry point, XCL now keeps only the standard Windows and user-profile variables plus XCL_* and removes the rest. XCL_KEEP_ENV=1 turns it off.

What is in it

  • crates/xcl/src/host.rs: scrub_title_env() before the title's entry point (case-insensitive keep-list: PATH, APPDATA, LOCALAPPDATA, USERPROFILE, SystemRoot, TEMP, ProgramFiles*, CommonProgramFiles* and similar; XCL_*); logs how many were removed; two unit tests.
  • README.md: a note on the scrub and XCL_KEEP_ENV=1.

Tested

  • RTX 2070 SUPER (driver 621.24), Ryzen 5 5500, Windows 11 26200, rustc 1.100.0, debug.
  • cargo test --workspace -- --test-threads=4: 662 passed, 0 failed, 21 ignored (after cargo build --workspace).
  • Unit tests: standard names kept (USERPROFILE, Path, ProgramFiles(x86) …), token-style names removed (GITHUB_TOKEN, AWS_SECRET_ACCESS_KEY …), a synthetic secret gone from the process environment.
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run

  • None: I have no title to run scripts/smoke.ps1 on. A smoke run from a tester would be appreciated, mainly to confirm no title needs a removed variable.

Not tested

  • Any retail title; whether a title or driver reads a variable outside the keep-list.

AI use

  • Claude Code (Claude Opus 5.5): wrote the change and tests, ran the suite.
**@⁠dadnotdaddy** on GitHub · 2026-11-24 04:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/740) `dadnotdaddy:fix-702` → `main` · +68 −0 · 2 files · 2 commits · open Fixes #702: the title runs in xcl.exe's process and inherited the PC's whole environment, so its crash dumps carried any tokens or keys set there. Before the entry point, XCL now keeps only the standard Windows and user-profile variables plus `XCL_*` and removes the rest. `XCL_KEEP_ENV=1` turns it off. **What is in it** - `crates/xcl/src/host.rs`: `scrub_title_env()` before the title's entry point (case-insensitive keep-list: `PATH`, `APPDATA`, `LOCALAPPDATA`, `USERPROFILE`, `SystemRoot`, `TEMP`, `ProgramFiles*`, `CommonProgramFiles*` and similar; `XCL_*`); logs how many were removed; two unit tests. - `README.md`: a note on the scrub and `XCL_KEEP_ENV=1`. **Tested** - RTX 2070 SUPER (driver 621.24), Ryzen 5 5500, Windows 11 26200, rustc 1.100.0, debug. - `cargo test --workspace -- --test-threads=4`: 662 passed, 0 failed, 21 ignored (after `cargo build --workspace`). - Unit tests: standard names kept (`USERPROFILE`, `Path`, `ProgramFiles(x86)` …), token-style names removed (`GITHUB_TOKEN`, `AWS_SECRET_ACCESS_KEY` …), a synthetic secret gone from the process environment. - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). **Regression run** - None: I have no title to run `scripts/smoke.ps1` on. A smoke run from a tester would be appreciated, mainly to confirm no title needs a removed variable. **Not tested** - Any retail title; whether a title or driver reads a variable outside the keep-list. **AI use** - Claude Code (Claude Opus 5.5): wrote the change and tests, ran the suite.
The title runs in xcl.exe's process and inherits the PC's whole
environment block; its own crash reporter uploads minidumps that carry
it (user and computer names, profile paths, credentials). A console
title sees no such environment.

Before the entry point, the host now removes every variable except a
few Windows / CRT ones (SystemRoot, windir, SystemDrive, TEMP, TMP,
ComSpec, PATHEXT, OS, NUMBER_OF_PROCESSORS, PROCESSOR_ARCHITECTURE) and
XCL_*. The DXIL cache folder, derived from LOCALAPPDATA, is pinned in
XCL_DXIL_CACHE first. XCL_KEEP_ENV=1 keeps the environment whole.

Tested with synthetic variables only: cargo test --workspace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Removing PATH, APPDATA, LOCALAPPDATA, USERPROFILE and the like risks
breaking titles and drivers that look them up. The title now keeps the
standard Windows and user-profile variables (case-insensitive) plus
XCL_*; custom variables, where tokens and keys live, still go. With
LOCALAPPDATA kept, the XCL_DXIL_CACHE pin is no longer needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:31:03 +00:00
Author
Owner

@⁠eizispark on GitHub · 2026-11-24 04:33 UTC · original

Hardware check of 5579aaca66256de17907590f66b75faed6e18a25 (verified clean merge with main 64b3f35): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace -- --test-threads=4: 703 passed, 0 failed, 41 ignored (GPU tests skipped on this adapter: none)
  • host::tests (2 unit tests: title_env_keeps_only_system_and_xcl_variables, remove_env_except_strips_the_process_block): passed; the 60 s retail smoke run below ran cleanly with the scrubbed environment (no title or AMD D3D12 driver issue from removed variables)

Regression run
main (f4ce27c):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1667 (PresentX 1667)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14847 MB

PR (5579aac):

xcl-smoke v1
commit: 5579aaca66256de17907590f66b75faed6e18a25
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1668 (PresentX 1668)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14854 MB

Not tested

  • wave32-only GPUs (NVIDIA / Intel); gameplay past the menus

AI use

  • Antigravity (Gemini 4 Carbon) ran the build, test suite, and scripts/smoke.ps1 harness on this machine and formatted this report.
**@⁠eizispark** on GitHub · 2026-11-24 04:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/740#issuecomment-7122130906) Hardware check of `5579aaca66256de17907590f66b75faed6e18a25` (verified clean merge with `main` `64b3f35`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, release + test profile - `cargo test --workspace -- --test-threads=4`: `703 passed, 0 failed, 41 ignored` (GPU tests skipped on this adapter: `none`) - `host::tests` (2 unit tests: `title_env_keeps_only_system_and_xcl_variables`, `remove_env_except_strips_the_process_block`): passed; the 60 s retail smoke run below ran cleanly with the scrubbed environment (no title or AMD D3D12 driver issue from removed variables) **Regression run** `main` (`f4ce27c`): ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1667 (PresentX 1667) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14847 MB ``` PR (`5579aac`): ``` xcl-smoke v1 commit: 5579aaca66256de17907590f66b75faed6e18a25 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1668 (PresentX 1668) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14854 MB ``` **Not tested** - wave32-only GPUs (NVIDIA / Intel); gameplay past the menus **AI use** - Antigravity (Gemini 4 Carbon) ran the build, test suite, and `scripts/smoke.ps1` harness on this machine and formatted this report.
Author
Owner

@⁠mastrr9 on GitHub · 2026-11-24 04:45 UTC · original

Code audit + NVIDIA RTX 5080 test run on 5579aaca66256de17907590f66b75faed6e18a25:

Review

Good security fix for #702 — scrubbing the Win32 PEB environment block before run_main keeps custom tokens/keys out of crash minidumps. Two notes worth considering:

  1. Wine / Linux & GPU driver env vars: title_env_keeps currently strips VKD3D_*, DXVK_*, WINE*, PROTON_*, MESA_*, RADV_*, VK_*, AMD_*, __NV_*, __GL_*, DISPLAY, and WAYLAND_DISPLAY. Any lazily loaded graphics/Wine library initialized after run_main (or child helper) loses those settings unless XCL_KEEP_ENV=1 is set; allowing those graphics/Wine prefixes (none of which carry secrets) would avoid breaking Linux/Wine or driver overrides.
  2. Comment clarity (host.rs:154): KEEP still retains USERNAME, USERDOMAIN, COMPUTERNAME, and USERPROFILE (needed for profile paths), so the comment might say it strips custom vars/credentials rather than user names and profile paths.

Tested

  • Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), rustc 1.100.0 (MSVC), debug build.
  • cargo build --workspace && cargo test --workspace -- --test-threads=4: 703 passed, 0 failed, 41 ignored.
  • New tests host::tests::title_env_keeps_only_system_and_xcl_variables and host::tests::remove_env_except_strips_the_process_block: both passed.
  • SKIPPED GPU tests (2, wave32-only adapter): gpu_geometry_wave32_prefix_count_over_a_mask: no wave64, gpu_wave32_program_in_wave64_hardware: no wave64.

Not tested

  • Retail title / scripts/smoke.ps1 run (test suite only); AMD / Intel / Wine.

AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.

**@⁠mastrr9** on GitHub · 2026-11-24 04:45 UTC · [original](https://github.com/xcl-dev/xcl/pull/740#issuecomment-7122310029) Code audit + NVIDIA RTX 5080 test run on `5579aaca66256de17907590f66b75faed6e18a25`: ### Review Good security fix for #702 — scrubbing the Win32 PEB environment block before `run_main` keeps custom tokens/keys out of crash minidumps. Two notes worth considering: 1. **Wine / Linux & GPU driver env vars:** `title_env_keeps` currently strips `VKD3D_*`, `DXVK_*`, `WINE*`, `PROTON_*`, `MESA_*`, `RADV_*`, `VK_*`, `AMD_*`, `__NV_*`, `__GL_*`, `DISPLAY`, and `WAYLAND_DISPLAY`. Any lazily loaded graphics/Wine library initialized after `run_main` (or child helper) loses those settings unless `XCL_KEEP_ENV=1` is set; allowing those graphics/Wine prefixes (none of which carry secrets) would avoid breaking Linux/Wine or driver overrides. 2. **Comment clarity (`host.rs:154`):** `KEEP` still retains `USERNAME`, `USERDOMAIN`, `COMPUTERNAME`, and `USERPROFILE` (needed for profile paths), so the comment might say it strips custom vars/credentials rather than user names and profile paths. ### Tested - Hardware / OS / toolchain: NVIDIA GeForce RTX 5080 (driver 617.42), AMD Ryzen 7 9800X3D, Windows 11 25H2 (build 26200.9711), `rustc 1.100.0` (MSVC), debug build. - `cargo build --workspace && cargo test --workspace -- --test-threads=4`: **703 passed, 0 failed, 41 ignored**. - New tests `host::tests::title_env_keeps_only_system_and_xcl_variables` and `host::tests::remove_env_except_strips_the_process_block`: **both passed**. - `SKIPPED` GPU tests (2, wave32-only adapter): `gpu_geometry_wave32_prefix_count_over_a_mask: no wave64`, `gpu_wave32_program_in_wave64_hardware: no wave64`. ### Not tested - Retail title / `scripts/smoke.ps1` run (test suite only); AMD / Intel / Wine. *AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.*
Author
Owner

@⁠throny on GitHub · 2026-11-24 06:26 UTC · original

Retail regression run for 5579aaca66256de17907590f66b75faed6e18a25 (this PR's head) on NVIDIA, as asked for in #42. Unedited scripts/smoke.ps1 output; the main block is this PR's merge base f4ce27c, so the two builds differ only by this PR.

Tested

  • Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 stable-x86_64-pc-windows-msvc; release builds (cargo build --release -p xcl), no uncommitted changes.
  • scripts/smoke.ps1 -Game <folder> -Seconds 60, a retail title, warm shader cache. Each build ran twice in a row; the blocks are the second runs. The first runs: f4ce27c 1630 frames, this PR 1639 frames, both exit 0x0, 0 device removals, 0 crashes.
  • The PR's log line appears once in its run: environment: 60 PC variables removed before the title starts. The title starts and reaches its menus without them on this NVIDIA driver.

Regression run

main (f4ce27c):

xcl-smoke v1
commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968
gpu: NVIDIA GeForce RTX 4080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1640 (PresentX 1640)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14749 MB

PR (5579aac):

xcl-smoke v1
commit: 5579aaca66256de17907590f66b75faed6e18a25
gpu: NVIDIA GeForce RTX 4080
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1635 (PresentX 1635)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14744 MB

Not tested

  • The test suite on this head (other reports here ran it).
  • A crash dump of the title, to confirm the removed variables are absent from it; XCL_KEEP_ENV=1.
  • AMD / wave64 hardware; anything past the title's menus (the run gets that far in 60 s).

AI use

  • Claude Code (Claude Fable 5.2) read the diff, built both commits, ran the script and wrote this report.
**@⁠throny** on GitHub · 2026-11-24 06:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/740#issuecomment-7123938794) Retail regression run for `5579aaca66256de17907590f66b75faed6e18a25` (this PR's head) on NVIDIA, as asked for in #42. Unedited `scripts/smoke.ps1` output; the `main` block is this PR's merge base `f4ce27c`, so the two builds differ only by this PR. **Tested** - Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4080 (driver 610.88, 32-lane waves), Intel i9-12900K, 64 GB; Rust 1.100.0 `stable-x86_64-pc-windows-msvc`; release builds (`cargo build --release -p xcl`), no uncommitted changes. - `scripts/smoke.ps1 -Game <folder> -Seconds 60`, a retail title, warm shader cache. Each build ran twice in a row; the blocks are the second runs. The first runs: `f4ce27c` 1630 frames, this PR 1639 frames, both exit 0x0, 0 device removals, 0 crashes. - The PR's log line appears once in its run: `environment: 60 PC variables removed before the title starts`. The title starts and reaches its menus without them on this NVIDIA driver. **Regression run** main (`f4ce27c`): ``` xcl-smoke v1 commit: f4ce27ceb6d1b0576d0c659b713b674778bf1968 gpu: NVIDIA GeForce RTX 4080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1640 (PresentX 1640) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14749 MB ``` PR (`5579aac`): ``` xcl-smoke v1 commit: 5579aaca66256de17907590f66b75faed6e18a25 gpu: NVIDIA GeForce RTX 4080 title: retail-title seconds: 60 exit: 0x0 frames shown: 1635 (PresentX 1635) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14744 MB ``` **Not tested** - The test suite on this head (other reports here ran it). - A crash dump of the title, to confirm the removed variables are absent from it; `XCL_KEEP_ENV=1`. - AMD / wave64 hardware; anything past the title's menus (the run gets that far in 60 s). **AI use** - Claude Code (Claude Fable 5.2) read the diff, built both commits, ran the script and wrote this report.
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 14:07 UTC · original

This and #730 (opened 7 minutes earlier) both fix #702. They differ in what reaches the title:

  • Kept here, removed by #730: USERNAME, USERPROFILE, HOMEDRIVE/HOMEPATH, USERDOMAIN, COMPUTERNAME, APPDATA, PUBLIC, ComSpec. #702 names "user names, profile paths" among what the crash reporter uploads. With this PR the title's environment still carries the account name, the machine name and the profile path; PATH too, which usually holds user directories.
  • #730 keeps the system and program-files variables and XCL_*, and sets PATH to %SystemRoot%\System32. It filters the environment of the process launcher.rs starts. This PR clears XCL's own environment in host.rs before the title's entry point.
  • #730 conflicts with main now; this PR merges cleanly. Both use XCL_KEEP_ENV=1 to opt out.

If this one is kept, dropping the identity variables from KEEP would cover the rest of #702, unless something in XCL or the title needs them. Read from the diffs only; I have not run either.

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-24 14:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/740#issuecomment-7133885409) This and #730 (opened 7 minutes earlier) both fix #702. They differ in what reaches the title: - **Kept here, removed by #730:** `USERNAME`, `USERPROFILE`, `HOMEDRIVE`/`HOMEPATH`, `USERDOMAIN`, `COMPUTERNAME`, `APPDATA`, `PUBLIC`, `ComSpec`. #702 names "user names, profile paths" among what the crash reporter uploads. With this PR the title's environment still carries the account name, the machine name and the profile path; `PATH` too, which usually holds user directories. - #730 keeps the system and program-files variables and `XCL_*`, and sets `PATH` to `%SystemRoot%\System32`. It filters the environment of the process `launcher.rs` starts. This PR clears XCL's own environment in `host.rs` before the title's entry point. - #730 conflicts with `main` now; this PR merges cleanly. Both use `XCL_KEEP_ENV=1` to opt out. If this one is kept, dropping the identity variables from `KEEP` would cover the rest of #702, unless something in XCL or the title needs them. Read from the diffs only; I have not run either. AI-assisted (Claude Code).
Author
Owner

@⁠throny on GitHub · 2026-11-24 19:38 UTC · original

Two contributors checked independently and found that #730 #766 solves the same problem (for #702) in a different way: #1607, group D17. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

**@⁠throny** on GitHub · 2026-11-24 19:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/740#issuecomment-7142380879) <!-- xcl-1607-hint:D17 --> Two contributors checked independently and found that #730 #766 solves the same problem (for #702) in a different way: #1607, group D17. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 11:28 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 11:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/740#issuecomment-7161103420) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/740/head:github-bot/gh-740'
git switch 'github-bot/gh-740'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-740'
git switch 'github-bot/gh-740'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-740'
git switch 'github-bot/gh-740'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-740'
git switch 'main'
git merge --squash 'github-bot/gh-740'
git switch 'main'
git merge --ff-only 'github-bot/gh-740'
git switch 'main'
git merge 'github-bot/gh-740'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.