run: refuse capture and dump paths inside the repo #679
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!679
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-679"
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?
@binarycleric on GitHub · 2026-11-24 06:43 UTC · original
binarycleric:fix/dump-paths-outside-repo→main· +60 −0 · 1 files · 1 commits · openProblem
Three debugging aids write game-derived data to a path taken from the environment, and none of them called
ensure_outside_repo:VICTORY_CAPTUREVICTORY_DUMP_TARGETS)VICTORY_AUDIO_CAPTUREVICTORY_XMA_DUMPScreenshots and audio are exactly what rule #1 keeps out of the repository, and
docs/asset-policy.mdsays everything that writes derived data callsensure_outside_repo. A path in the working tree would put them onegit addaway from a commit.Fix
runchecks all three variables before anything is loaded and stops with the existingPolicyError::InsideRepo, with the variable named as context:The check is in
runrather than at each writer because the writers live invictory-gpuandvictory-hle, which don't depend onvictory-core. The audio recorder is a child process thatrunstarts, so it's covered as well. Same approach as #664 forVICTORY_EMIT_DUMP.Testing
apps/victory/src/run.rs: each variable is refused for paths inside the repo, and outside or unset paths pass. The helper takes the environment as a closure, so the tests don't mutate process env.cargo test --workspaceandcargo xtask policypass; clippy reports nothing in the changed file.victory runwithVICTORY_CAPTUREin the repo is refused before the exe is read; unset, behaviour is unchanged.@geiyiliyabumo on GitHub · 2026-11-24 10:08 UTC · original
Independent verification of
b96c85d47merged withmain(ffe310e, clean merge) on Windows 11 Pro (26100), Rust1.98.1(x86_64-pc-windows-msvc): PASS.cargo xtask policy→asset policy: 154 files okcargo clippy --workspace --all-targets --locked -- -D warnings→ pass (0 warnings)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings→ pass (0 warnings)cargo test -p victory --locked→ 3 passed, 0 failed (both newrun::dump_path_tests::dump_paths_inside_the_repo_are_refusedanddump_paths_outside_the_repo_and_unset_ones_passpass)check_dump_pathsruns before title loading /Config::load, covers all three env vars (VICTORY_CAPTURE,VICTORY_AUDIO_CAPTURE,VICTORY_XMA_DUMP) with variable-name context, and refusing empty-string values whencwdis inside the repo matchescapture.rs:15andaudio.rs:631(which also checkvar_osdirectly without ignoring empty strings).AI-assisted; synthetic tests only, no game files.
@ErRusso on GitHub · 2026-11-24 11:23 UTC · original
Audit: ✅ Looks good (needs Windows to fully compile)
Reviewed this PR as part of an audit of mergeable PRs.
apps/victory/src/run.rs(+60/-0). Addscheck_dump_paths()which validatesVICTORY_CAPTURE,VICTORY_AUDIO_CAPTURE, andVICTORY_XMA_DUMPagainstensure_outside_repo()before the title can write anything. Includes tests that verify inside-repo paths (both file and dir) are refused and temp-dir paths pass.check_dump_pathstakes an environment closure, making it testable without actual env vars.main.dump_path_testsmodule depends on thevictorybinary crate which transitively depends onvictory-gpu, which doesn't compile on Linux (pre-existing#[cfg(windows)]gating gap). The test logic is straightforward:ensure_outside_repois already tested invictory-core.No issues found in the diff.
@molodayamama on GitHub · 2026-11-24 14:02 UTC · original
Independent Windows check of
b96c85d47d7c5d9b2e7f1673e0a59deb36c4aa31(Windows 10 22H2 19045, Rust 1.98.1, MSVC x64).cargo test -p victory --locked --bin victory dump_paths_ -- --test-threads=1 --nocapture: 2 passed.The synthetic path fixtures cover refusing capture/dump paths inside the repository while accepting paths outside it and unset settings. This exercises the guard directly.
Only source-built synthetic fixtures were used. AI-assisted verification.
@Marvisak on GitHub · 2026-11-25 00:34 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:apps/victory/src/run.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.