Derived data can be written into the repository: VICTORY_RECORD, replay --images and --retranslate, shaders --list skip ensure_outside_repo #510
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD#510
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@itsonewi on GitHub · 2026-11-27 07:57 UTC · original
What happens
docs/asset-policy.mdmakes the runtime check part of rule #1:docs/asset-policy.md:51-52, with what must never land in the tree spelled out above it: "anything derived from those: converted assets, decompiled or disassembled code, shader dumps, extracted tables, screenshots" (:13-15).Five places do call it:
apps/victory/src/translate.rs:250-255— theVICTORY_EMIT_DUMPfolder: "Dumped shaders and validator reports are game-derived (rule #1)";crates/victory-gpu/src/titlewrite.rs:306-315—VICTORY_WRITE_SITES's file, with the doc comment "file, if it is outside every source tree: its lines are places in the title's code (docs/asset-policy.md). Said once if not";crates/victory-pipeline/src/cache.rs:39,crates/victory-loader/src/windows.rs:56, andvictory config's check (apps/victory/src/main.rs:294).The write targets that are chosen by hand — where a mistake is most likely, since the default is safe and an explicit path is not — have no check at all:
VICTORY_RECORD=<folder>casts the frame:record.rs:61takes the folder straight from the environment,:408makes it (std::fs::create_dir_all(&settings.folder)?), and the capture is written there (shaders.binat:418, the frame's memory and lists beside it). Nothing looks at where that folder is.victory replay --images <folder>writes pictures of the title's textures — the "screenshots" of:15:apps/victory/src/replay.rs:309-324buildsplay::look::Images { folder: folder.clone(), .. }and hands it toplayer.images(...).victory replay --retranslate <folder>writes the title's shader containers and their DXIL — the "shader dumps" of:15:apps/victory/src/replay.rs:441-442(create_dir_all(&kept),create_dir_all(&into)),:461({hash}.cdxil, the container bytes taken out of the title's files) and:482({hash}.dxil).victory shaders --list <file>writes one line per untranslated shader with its hash, the path it was found at and the reason:apps/victory/src/translate.rs:465-470(std::fs::write(list, …)), while the neighbouring dump of the same run (:250-255) is checked.grep ensure_outside_repoover the tree returns exactly the five call sites above and none of these four.Why it matters
The policy's own "If something slips through" section says a follow-up commit is not enough — the history has to be rewritten and everyone re-clones. That is the cost of one
VICTORY_RECORDor--imagespointed at the working tree (a shell in the repo root, a-Moreentry inscripts/play.ps1, a--images shotstyped where the capture lives), and the recorder is the worst of the four: it writes the frame's recorded memory, gigabytes of it, in one go.cargo xtask policywould then have to catch it before a commit, and it only knows file types, sizes and signatures.The check already exists, costs one
canonicalizeper path, and three of these four paths are in code that already refuses other bad input (--retranslateerrors on a missing container folder,--imageson a bad--texture), so refusing a path inside the tree is a one-line change in each.Suggested fix
victory_core::ensure_outside_repo(&folder)?before the first write, with the path in the error:crates/victory-gpu/src/replay/record.rs, inSettings::from_env(:58-62) — the recorder cannot return an error, so log it astitlewrite::outside_repodoes and record nothing;apps/victory/src/replay.rs, at the top of the--imagesbranch (:309) and at the top ofretranslate(:438-442), before eithercreate_dir_all;apps/victory/src/translate.rs, inprecompilewhere--listis written (:465), asrunalready does forVICTORY_EMIT_DUMP.A test in the shape of the existing policy tests (a temp dir inside the workspace root is refused, one outside is accepted) would keep the next output path honest.
AI use
Found by an AI agent (Freebuff) reading
a-publierthrough the GitHub API, after deduplicating against the open and closed issues (a search for "outside the repository" returns only #275, #101 and #35, none of them this). Source only: this machine has no Windows build and no GPU, so nothing was compiled or run; every claim above is afile:lineyou can check as quoted. Filed by the same agent that filed #280–#293, #301, #302 and #311.--looks) and leaves out five that do #513VICTORY_AMBIENT_SETTLE,VICTORY_MOUSE_SENSorVICTORY_DSTORAGE_STAGING_MBis silently the default (for the first, silently off) #514VICTORY_FSR_4Kset,VICTORY_OUTPUT,VICTORY_RENDER_SCALE,VICTORY_FFX_SCALEandVICTORY_UPSCALERare dropped without a word #516