xcl run: the title no longer inherits the PC's environment, so dumps carry no secrets (#702) #735
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/740"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by dadnotdaddy on 2026-11-24T04:21:54Z.
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=1turns 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 andXCL_KEEP_ENV=1.Tested
cargo test --workspace -- --test-threads=4: 662 passed, 0 failed, 21 ignored (aftercargo build --workspace).USERPROFILE,Path,ProgramFiles(x86)…), token-style names removed (GITHUB_TOKEN,AWS_SECRET_ACCESS_KEY…), a synthetic secret gone from the process environment.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64).Regression run
scripts/smoke.ps1on. A smoke run from a tester would be appreciated, mainly to confirm no title needs a removed variable.Not tested
AI use
Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T04:33:40Z.
Hardware check of
5579aaca66256de17907590f66b75faed6e18a25(verified clean merge withmain64b3f35): pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo 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):PR (
5579aac):Not tested
AI use
scripts/smoke.ps1harness on this machine and formatted this report.Imported from ivall/xcl. Originally posted by ethandepstein-del on 2026-11-24T04:45:26Z.
Code audit + NVIDIA RTX 5080 test run on
5579aaca66256de17907590f66b75faed6e18a25:Review
Good security fix for #702 — scrubbing the Win32 PEB environment block before
run_mainkeeps custom tokens/keys out of crash minidumps. Two notes worth considering:title_env_keepscurrently stripsVKD3D_*,DXVK_*,WINE*,PROTON_*,MESA_*,RADV_*,VK_*,AMD_*,__NV_*,__GL_*,DISPLAY, andWAYLAND_DISPLAY. Any lazily loaded graphics/Wine library initialized afterrun_main(or child helper) loses those settings unlessXCL_KEEP_ENV=1is set; allowing those graphics/Wine prefixes (none of which carry secrets) would avoid breaking Linux/Wine or driver overrides.host.rs:154):KEEPstill retainsUSERNAME,USERDOMAIN,COMPUTERNAME, andUSERPROFILE(needed for profile paths), so the comment might say it strips custom vars/credentials rather than user names and profile paths.Tested
rustc 1.100.0(MSVC), debug build.cargo build --workspace && cargo test --workspace -- --test-threads=4: 703 passed, 0 failed, 41 ignored.host::tests::title_env_keeps_only_system_and_xcl_variablesandhost::tests::remove_env_except_strips_the_process_block: both passed.SKIPPEDGPU 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
scripts/smoke.ps1run (test suite only); AMD / Intel / Wine.AI use: code review and test run orchestrated with Antigravity (Gemini 4 Neon) on the hardware listed above.
Imported from ivall/xcl. Originally posted by throny on 2026-11-24T06:26:40Z.
Retail regression run for
5579aaca66256de17907590f66b75faed6e18a25(this PR's head) on NVIDIA, as asked for in #42. Uneditedscripts/smoke.ps1output; themainblock is this PR's merge basef4ce27c, so the two builds differ only by this PR.Tested
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:f4ce27c1630 frames, this PR 1639 frames, both exit 0x0, 0 device removals, 0 crashes.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):PR (
5579aac):Not tested
XCL_KEEP_ENV=1.AI use
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T14:07:47Z.
This and #730 (opened 7 minutes earlier) both fix #702. They differ in what reaches the title:
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;PATHtoo, which usually holds user directories.XCL_*, and setsPATHto%SystemRoot%\System32. It filters the environment of the processlauncher.rsstarts. This PR clears XCL's own environment inhost.rsbefore the title's entry point.mainnow; this PR merges cleanly. Both useXCL_KEEP_ENV=1to opt out.If this one is kept, dropping the identity variables from
KEEPwould 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).
upstream-sync referenced this pull request2026-11-24 19:06:45 +00:00
Imported from ivall/xcl. Originally posted by throny on 2026-11-24T19:38:20Z.
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.
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
upstream-sync referenced this pull request2026-11-25 02:07:14 +00:00
upstream-sync referenced this pull request2026-11-25 06:04:27 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:28:54Z.
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!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:43:57Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Pull request closed