loader(windows): reject non-simple, ADS, and NUL title DLL import names #94
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/94"
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 Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T09:34:15Z.
Summary
Adapted from upstream
VIctory-NVIDIA(de2574d0, GPL-3.0), extracted cleanly onorigin/main(5d40f8b) with zero overlap against any open PR:crates/victory-loader/src/windows.rs): Addsis_simple_title_dll_name()insidemap_dll()afterseen/wantedchecks and beforedirs.0.join(&name)so non-simple module names (parent components, subdirectories, drive/UNC prefixes, NTFS:alternate streams, and embedded\0) are ignored with a warning log.Verification
cargo xtask policy:asset policy: 303 files okcargo test -p victory-loader --lib --locked: 54 passed; 0 failed (including 5 newwindows::tests::*cases)cargo clippy --workspace --all-targets --locked -- -D warnings: 0 warningscargo clippy --workspace --all-targets --features diagnostics --locked -- -D warnings: 0 warningsImported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T10:02:46Z.
Automated triage for the maintainers (not an approval).
Verdict:
merge-candidate· CI (check):passingReview Summary
Clean, well-scoped security hardening in
crates/victory-loader/src/windows.rs.map_dll(): Reordersseen.insert/wanted(&name)checks ahead ofdirs.0.join(&name)and guards path joining withis_simple_title_dll_name(&name), logging atracing::warn!and returningOk(())for rejected names. This preserves host/HLE import filtering while preventing untrusted PE import/delay-import names (orload_title_dllinputs) from escapingtitle_dirvia relative traversal, subdirectories, drive/UNC prefixes, NTFS alternate data streams (:), or embedded NUL bytes (\0).is_simple_title_dll_name(): Checksname.contains([':', '\0'])and verifiesPath::new(name).components()yields exactly oneComponent::Normal(_), with a clear doc comment noting the lexical scope (symlink/reparse-point containment left to future canonicalization).windows::testscovering normal DLL names, parent traversal (../,..\), subdirectories, ADS/NUL, and rooted/drive/UNC/verbatim prefixes.Verdict:
merge-candidate(automated triage review; not a formal maintainer approval).Generated with Antigravity CLI (
agy).