fix(pe): validate section raw data bounds #219
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!219
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/219/head"
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?
@DiegoFR20 on GitHub · 2026-11-24 01:33 UTC · original
DiegoFR20:investigation/pe-validation→main· +94 −1 · 1 files · 1 commits · merged 2026-11-25 00:10 UTCSummary
Motivation
ImageInfo::parse()previously accepted a synthetic PE image whose section header declared more raw data than the file contained.This could allow
rva_to_file_offset()to return an offset beyond the available file bytes.Testing
cargo test -p victory-pecargo test --workspacecargo clippy -p victory-pe --all-targets -- -D warningsAll passed locally.
Compatibility question
Should the parser strictly reject sections whose declared raw-data ranges extend beyond EOF, or does VIctory intentionally support partially truncated PE images?
Opening as a draft to confirm the expected behavior before requesting a merge.
@jeremygold02 on GitHub · 2026-11-24 05:14 UTC · original
Thanks @DiegoFR20 for tightening the raw section-data bounds while preserving valid boundary cases.
I tested commit
e57e76a7b4058e50d665ddcc9a11eb3cd4de4e7dwith:All 3 targeted tests passed (0 failed; 7 filtered):
rejects_section_extending_beyond_filerejects raw section data whose end exceeds the input image.accepts_section_ending_at_file_boundaryaccepts data ending exactly at EOF.accepts_section_with_zero_raw_sizeaccepts a virtual section with no raw bytes.These are synthetic PE parser boundary tests; they do not load a real executable.