Shader scan: trailing file bytes change the hash of a raw DXBC container #246

Open
opened 2026-11-26 03:39:11 +00:00 by github-bot · 0 comments
Owner

@⁠Bennet0k on GitHub · 2026-11-24 22:59 UTC · original

Source · Source

Reproduction. Scan a valid synthetic 32-byte DXBC container, then append harmless tail after the declared container length and scan it again. Executing the original parser and raw-source code returns 32 bytes and hash 252d095627775c35 for the standalone container, versus 45 bytes and e4f0aa8725373303 for the embedded container. The parser recognizes the same container both times. The longer slice also flows into diagnostic dumps.

Proposed fix. Have the raw-source iterator return exactly the byte range validated by the parser, preferably using the parser's checked length. Add a test asserting identical source bytes and hashes for standalone and embedded copies. This lets VICTORY_TRANSLATE_ONLY match the hash of the same container from runtime logs.

Found in an AI-assisted audit of 2119b0e.

**@⁠Bennet0k** on GitHub · 2026-11-24 22:59 UTC · [original](https://github.com/fxceless/victory-fork/issues/246) [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/apps/victory/src/shader.rs#L38-L52) · [Source](https://github.com/fxceless/victory-fork/blob/2119b0e44c53aa9648307b0c5c73590290305b1f/apps/victory/src/translate.rs#L317-L339) **Reproduction.** Scan a valid synthetic 32-byte DXBC container, then append `harmless tail` after the declared container length and scan it again. Executing the original parser and raw-source code returns 32 bytes and hash `252d095627775c35` for the standalone container, versus 45 bytes and `e4f0aa8725373303` for the embedded container. The parser recognizes the same container both times. The longer slice also flows into diagnostic dumps. **Proposed fix.** Have the raw-source iterator return exactly the byte range validated by the parser, preferably using the parser's checked length. Add a test asserting identical source bytes and hashes for standalone and embedded copies. This lets `VICTORY_TRANSLATE_ONLY` match the hash of the same container from runtime logs. Found in an AI-assisted audit of `2119b0e`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:39:11 +00:00
This discussion has been locked. Commenting is limited to contributors.
No milestone
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
github/fxceless--victory-fork#246
No description provided.