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

Open
opened 2026-11-24 22:59:47 +00:00 by Bennet0k · 0 comments
Bennet0k commented 2026-11-24 22:59:47 +00:00 (Migrated from github.com)
Contributor

Imported from fxceless/victory-fork. Originally posted by Bennet0k on 2026-11-24T22:59:47Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593123715 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/246). Originally posted by [Bennet0k](https://github.com/Bennet0k) on 2026-11-24T22:59:47Z. --- [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`.
Sign in to join this conversation.
No labels
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.

Reference
fxceless/victory-fork#246
No description provided.