[GH-ISSUE #963] Security review of everything merged since 5d74c27 (no malware found; one build-time supply-chain note) #23

Open
opened 2026-11-26 20:14:01 +01:00 by 4ld0 · 2 comments
Owner

Originally created by @adrianmjim on GitHub (Nov 24, 2026).
Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/963

The repository changed hands and a lot was merged very fast: the mass merge before the original went private, then this continuation. So I read everything that landed between 5d74c27 (the last upstream commit I had audited before) and 23c459644 (main at 2026-11-24 14:37 UTC), looking for anything harmful to someone who builds and runs it. That is 629 files, about +61k/−4k lines.

How: read-only. Eleven reviewers each read every file in one slice of git diff 5d74c27 23c459644, and one more covered the build entry points: README path, Build.*, Mods.*, make_game.py, scripts/, CMake, Cargo, workflows and the viewer. Three independent skeptics then re-checked every flagged item. Nothing was executed during the review. Afterwards the tree was built and its tests were run (below).

Result: nothing malicious. There is no obfuscation (no encoded blobs, exec/eval/pickle, or bidi/zero-width characters). There is no credential, environment or browser access, no persistence, no Defender/UAC changes, and no committed binaries. Every subprocess call uses an argument list, with no shell=True or command strings. The new ws2_offline shim restricts the title's networking to loopback rather than opening it. The viewer's CDN scripts now carry SRI hashes. conflict-label.yml uses pull_request_target safely: it checks out the default branch only, with persist-credentials: false.

One supply-chain note (not malware): runtime/CMakeLists.txt:109-127 (from cfcedb58e) runs cargo build at configure time whenever cargo is on PATH. That fetches github.com/omonkeyz/xbox-emulator at 27122f7 (package xma) and links it statically into gta6rt.exe. There is no opt-in: anyone who happens to have Rust installed builds third-party code during cmake. I reviewed that crate at the pinned rev:

  • it is pure Rust, a port of FFmpeg's WMA Pro/XMA2 decoder (bits/mdct/tables/wmapro);
  • it has no dependencies, no build.rs, no proc-macros and no unsafe;
  • the library does no I/O (only its tests read sample files);
  • --locked and the commit pin hold it to that code.

So it is fine today. Still, worth considering an explicit -DLEONIDA_XMA2_DECODER=ON opt-in, or vendoring the ~90 KB crate under third_party/. Then a later bump of the pin shows up as a reviewable diff in this repo instead of a one-line rev change pointing at another account's repository.

Smaller observations:

  • README.md replaced the local tools/pc_checker.py with a link to an external site. #709 restores the tool.
  • The new Telegram link and several Discord-invite swaps were pushed directly to main, not through PRs.
  • Six PRs from branches inside this repository (about 3.8k lines, including runtime shims and the cargo step) were merged within 33 seconds of each other.
  • Merge 6dece9231 dropped ~28 files from the merged branch. fiestorra already reported this in #14, and the restore PRs (#131, #641, #709, #821, #848, …) cover most of it.

Built and run afterwards at 23c459644 on an AMD Radeon RX 7900 XT (RDNA3, AMD 26.11.2 / 32.0.32029.2010), Windows 11, VS 2022, Vulkan SDK 1.4.363.0:

  • tests/semantic: 465 files, 6108 tests, 1 file failed. It is test_image_cube_store_glc, a Windows LLVM_MC path issue fixed by #837.
  • run_gpu_tests.py: 258/258 translated and spirv-val clean. 231/249 passed, 16 skipped, 2 failed (the two cs_imgload*_tfe fixtures, #31/#98).
  • Full ctest: 300/305. The failures are vk_queue_query_sync, d3d12_texture_tiles, d3d12_execute_indirect_validation (#504), d3d12_clear (#516/#787) and d3d12_pipeline_library_host (finding in #14). These are the same five that #787 lists for an RX 7900 XTX.

No game files were used. AI-assisted (Claude Code); every finding was re-checked against the code.

Originally created by @adrianmjim on GitHub (Nov 24, 2026). Original GitHub issue: https://github.com/ubiquitarianism/leonida/issues/963 The repository changed hands and a lot was merged very fast: the mass merge before the original went private, then this continuation. So I read everything that landed between `5d74c27` (the last upstream commit I had audited before) and `23c459644` (main at 2026-11-24 14:37 UTC), looking for anything harmful to someone who builds and runs it. That is 629 files, about +61k/−4k lines. **How:** read-only. Eleven reviewers each read every file in one slice of `git diff 5d74c27 23c459644`, and one more covered the build entry points: README path, `Build.*`, `Mods.*`, `make_game.py`, `scripts/`, CMake, Cargo, workflows and the viewer. Three independent skeptics then re-checked every flagged item. Nothing was executed during the review. Afterwards the tree was built and its tests were run (below). **Result: nothing malicious.** There is no obfuscation (no encoded blobs, `exec`/`eval`/`pickle`, or bidi/zero-width characters). There is no credential, environment or browser access, no persistence, no Defender/UAC changes, and no committed binaries. Every subprocess call uses an argument list, with no `shell=True` or command strings. The new `ws2_offline` shim restricts the title's networking to loopback rather than opening it. The viewer's CDN scripts now carry SRI hashes. `conflict-label.yml` uses `pull_request_target` safely: it checks out the default branch only, with `persist-credentials: false`. **One supply-chain note (not malware):** `runtime/CMakeLists.txt:109-127` (from `cfcedb58e`) runs `cargo build` at configure time whenever `cargo` is on PATH. That fetches `github.com/omonkeyz/xbox-emulator` at `27122f7` (package `xma`) and links it statically into `gta6rt.exe`. There is no opt-in: anyone who happens to have Rust installed builds third-party code during `cmake`. I reviewed that crate at the pinned rev: - it is pure Rust, a port of FFmpeg's WMA Pro/XMA2 decoder (bits/mdct/tables/wmapro); - it has no dependencies, no `build.rs`, no proc-macros and no `unsafe`; - the library does no I/O (only its tests read sample files); - `--locked` and the commit pin hold it to that code. So it is fine today. Still, worth considering an explicit `-DLEONIDA_XMA2_DECODER=ON` opt-in, or vendoring the ~90 KB crate under `third_party/`. Then a later bump of the pin shows up as a reviewable diff in this repo instead of a one-line rev change pointing at another account's repository. **Smaller observations:** - `README.md` replaced the local `tools/pc_checker.py` with a link to an external site. #709 restores the tool. - The new Telegram link and several Discord-invite swaps were pushed directly to main, not through PRs. - Six PRs from branches inside this repository (about 3.8k lines, including runtime shims and the cargo step) were merged within 33 seconds of each other. - Merge `6dece9231` dropped ~28 files from the merged branch. fiestorra already reported this in #14, and the restore PRs (#131, #641, #709, #821, #848, …) cover most of it. **Built and run afterwards at `23c459644`** on an AMD Radeon RX 7900 XT (RDNA3, AMD 26.11.2 / 32.0.32029.2010), Windows 11, VS 2022, Vulkan SDK 1.4.363.0: - `tests/semantic`: 465 files, 6108 tests, 1 file failed. It is `test_image_cube_store_glc`, a Windows `LLVM_MC` path issue fixed by #837. - `run_gpu_tests.py`: 258/258 translated and `spirv-val` clean. 231/249 passed, 16 skipped, 2 failed (the two `cs_imgload*_tfe` fixtures, #31/#98). - Full `ctest`: 300/305. The failures are `vk_queue_query_sync`, `d3d12_texture_tiles`, `d3d12_execute_indirect_validation` (#504), `d3d12_clear` (#516/#787) and `d3d12_pipeline_library_host` (finding in #14). These are the same five that #787 lists for an RX 7900 XTX. No game files were used. AI-assisted (Claude Code); every finding was re-checked against the code.
Author
Owner

@pickles976 commented on GitHub (Nov 24, 2026):

Independent spot-verification of the load-bearing claims, done read-only against the tree at the audited ref (23c459644) from a second party — all confirmed, including one I came to disprove:

  • runtime/CMakeLists.txt:109-127: configure-time cargo build --release --locked gated only on find_program(cargo) — no opt-in, confirmed.
  • I initially suspected the supply-chain note had gone stale at the audited ref (there is an in-tree runtime/xma_decoder/ wrapper, so I hypothesized vendoring had already landed) — it has not: the wrapper's Cargo.toml carries xma = { git = "https://github.com/omonkeyz/xbox-emulator", rev = "27122f7…" } and Cargo.lock pins the same source. Your finding stands exactly as written. Good thing the claim got re-checked before my correction would have posted.
  • The only other URL-sourced downloads in the file are official-release tarballs (SDL 3.4.20, Vulkan-Headers at a full rev), consistent with "nothing hidden."

One correctness twin to your supply-chain note, same line of code: when the fetch fails — offline machine, blocked GitHub, cargo absent-but-networked — execute_process fails after up to TIMEOUT 120, and the build degrades via message(WARNING … "XMA voices will be silent"). That is a silent feature-loss build mode: the binary configures, builds, runs, and every XMA2 audio voice is silently absent, with a CMake warning as the only trace. Users will report that as a game bug (audio classes missing), and the report will not mention the warning. So -DLEONIDA_XMA2_DECODER=ON (or vendoring, which additionally kills the offline failure) is not just hygiene — it makes the feature-loss path a deliberate choice instead of a race against a network. The vendoring variant would also convert the audited-crate review into a reviewable local diff exactly as you proposed; the ~90 KB size makes that trivial.

Cross-project action taken from your writeup verbatim: xcl deserves this same review before the weekend is over — a merge surge (BCPack, DXC trio, Wait64 family) plus a 460-issue backlog is precisely the condition that motivated yours. Our lanes are static-only by policy anyway; a read-only diff audit of everything merged since the handover is the right sibling check, and the methodology (slice reviewers + skeptic re-check + build-then-test) is worth copying as-is.

<!-- gh-comment-id:7136931269 --> @pickles976 commented on GitHub (Nov 24, 2026): Independent spot-verification of the load-bearing claims, done read-only against the tree at the audited ref (`23c459644`) from a second party — **all confirmed, including one I came to disprove**: - `runtime/CMakeLists.txt:109-127`: configure-time `cargo build --release --locked` gated only on `find_program(cargo)` — no opt-in, confirmed. - I initially suspected the supply-chain note had gone stale at the audited ref (there *is* an in-tree `runtime/xma_decoder/` wrapper, so I hypothesized vendoring had already landed) — **it has not**: the wrapper's `Cargo.toml` carries `xma = { git = "https://github.com/omonkeyz/xbox-emulator", rev = "27122f7…" }` and `Cargo.lock` pins the same source. Your finding stands exactly as written. Good thing the claim got re-checked before my correction would have posted. - The only other URL-sourced downloads in the file are official-release tarballs (SDL 3.4.20, Vulkan-Headers at a full rev), consistent with "nothing hidden." One **correctness twin** to your supply-chain note, same line of code: when the fetch fails — offline machine, blocked GitHub, cargo absent-but-networked — `execute_process` fails after up to `TIMEOUT 120`, and the build degrades via `message(WARNING … "XMA voices will be silent")`. That is a **silent feature-loss build mode**: the binary configures, builds, runs, and every XMA2 audio voice is silently absent, with a CMake warning as the only trace. Users *will* report that as a game bug (audio classes missing), and the report will not mention the warning. So `-DLEONIDA_XMA2_DECODER=ON` (or vendoring, which additionally kills the offline failure) is not just hygiene — it makes the feature-loss path a deliberate choice instead of a race against a network. The vendoring variant would also convert the audited-crate review into a reviewable local diff exactly as you proposed; the ~90 KB size makes that trivial. Cross-project action taken from your writeup verbatim: **xcl deserves this same review before the weekend is over** — a merge surge (BCPack, DXC trio, Wait64 family) plus a 460-issue backlog is precisely the condition that motivated yours. Our lanes are static-only by policy anyway; a read-only diff audit of everything merged since the handover is the right sibling check, and the methodology (slice reviewers + skeptic re-check + build-then-test) is worth copying as-is.
Author
Owner

@pickles976 commented on GitHub (Nov 24, 2026):

Audit result for the sibling repo, as proposed above — red-flag pass over ivall/xcl's own merge surge (425 commits, origin/main from the first surge commit at 03:50Z through head 930e8b4), read-only, scoped the way your method scopes the highest-risk surface first: build system, dependency manifests, scripts, workflows, and non-source files — plus everything your reviewer profile would grep for:

  • Cargo.toml: one diff hunk across the window — [profile.release] debug = 2 (keeps symbols in alpha builds so release crashes resolve; benign, transparency-positive). No new dependencies, no build.rs, no new crates anywhere in the window.
  • New scripts (gen_bcpack_victory_tables.py, tests/data/bcpack/generate.py): stdlib only (struct, random, deque, pathlib) — no network, no subprocess, no exec, no encoded blobs. pr_check.py/test.ps1 changes are the CI lint and a missing-sample-env check (lists the XCL_SAMPLE_* vars that are unset) — the latter is exactly the transparency of build-time inputs your note argues for.
  • Binary test data (BCPack vectors, 28 files): all small, all regenerable by the committed generate.py, .gitattributes declares them binary — nothing over 1 MB anywhere in the data dir, no executables, no committed DLLs.
  • No credential/environment reads beyond XCL_* config vars and CARGO_*; no base64 payloads; no obfuscation patterns (the grep class from your writeup, run in full: encoded blobs, eval/exec equivalents in scripts, bidi/zero-width — clean).

Honest scope limits vs your method: build/dep/script surface fully covered for the window; the Rust source (~420 commits of it) is reviewed per-PR by the community and me as it lands (verdict comments on #1362/#1364/#1367/#1397/#1398 etc.), not by an 11-reviewer whole-diff read — so "nothing malicious found" holds for the classes this scan can see, and semantic review remains continuous rather than a point-in-time certificate. Happy to run the deeper slice read overnight if you consider the Rust lanes part of the same trust boundary; on our side we would treat your vendored-decoder opt-in result as the template for any future build-time fetch here.

<!-- gh-comment-id:7136970765 --> @pickles976 commented on GitHub (Nov 24, 2026): **Audit result for the sibling repo, as proposed above** — red-flag pass over ivall/xcl's own merge surge (425 commits, `origin/main` from the first surge commit at 03:50Z through head `930e8b4`), read-only, scoped the way your method scopes the highest-risk surface first: **build system, dependency manifests, scripts, workflows, and non-source files** — plus everything your reviewer profile would grep for: - `Cargo.toml`: one diff hunk across the window — `[profile.release] debug = 2` (keeps symbols in alpha builds so release crashes resolve; benign, transparency-positive). **No new dependencies, no build.rs, no new crates anywhere in the window.** - New scripts (`gen_bcpack_victory_tables.py`, `tests/data/bcpack/generate.py`): stdlib only (`struct`, `random`, `deque`, `pathlib`) — **no network, no subprocess, no exec, no encoded blobs**. `pr_check.py`/`test.ps1` changes are the CI lint and a **missing-sample-env check** (lists the `XCL_SAMPLE_*` vars that are unset) — the latter is exactly the transparency of build-time inputs your note argues for. - Binary test data (BCPack vectors, 28 files): all small, all regenerable by the committed `generate.py`, `.gitattributes` declares them binary — nothing over 1 MB anywhere in the data dir, no executables, no committed DLLs. - No credential/environment reads beyond `XCL_*` config vars and `CARGO_*`; no base64 payloads; no obfuscation patterns (the grep class from your writeup, run in full: encoded blobs, `eval/exec` equivalents in scripts, bidi/zero-width — clean). **Honest scope limits vs your method**: build/dep/script surface fully covered for the window; the Rust source (~420 commits of it) is reviewed **per-PR by the community and me** as it lands (verdict comments on #1362/#1364/#1367/#1397/#1398 etc.), not by an 11-reviewer whole-diff read — so "nothing malicious found" holds for the classes this scan can see, and semantic review remains continuous rather than a point-in-time certificate. Happy to run the deeper slice read overnight if you consider the Rust lanes part of the same trust boundary; on our side we would treat your vendored-decoder opt-in result as the template for any future build-time fetch here.
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#23
No description provided.