RPC: UuidFromString takes only the dashed GUID form, braces paired (junk after } was accepted) #261

Open
github-bot wants to merge 1 commit from github-bot/gh-261 into main AGit
Owner

@⁠sharan104 on GitHub · 2026-11-26 13:33 UTC · original
sharan104:fix/kernel-audit → main · +40 −9 · 1 files · 1 commits · open

rpcrt4.rs parse(), which UuidFromStringA/W use, skipped dashes wherever they stood, and returned as soon as a } followed the 32nd digit. So malformed text returned RPC_S_OK where the runtime returns RPC_S_INVALID_STRING_UUID:

  • junk after the closing brace: …abcde}junk
  • a brace with no pair: {… or …}
  • doubled braces: {{…}
  • dashes missing or out of place

The function's own comment ("the dashes in place") and the existing garbage_is_refused test show this text was meant to be refused.

Fix: the text must be exactly xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, optionally inside one pair of braces. Braces stay accepted, as the code and its test deliberately allow. parse has no other callers.

Test: malformed_guid_text_is_refused covers 9 malformed strings. It fails before the change and passes after it (10 runs out of 10). The existing valid-GUID tests (upper case, braces, A and W) still pass.

Results:

  • cargo test -p victory-hle --locked: 156 passed, 2 ignored.
  • cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warnings is clean, with and without --all-features.

🤖 Generated with Claude Code

**@⁠sharan104** on GitHub · 2026-11-26 13:33 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/261) `sharan104:fix/kernel-audit` → `main` · +40 −9 · 1 files · 1 commits · open `rpcrt4.rs` `parse()`, which `UuidFromStringA/W` use, skipped dashes wherever they stood, and returned as soon as a `}` followed the 32nd digit. So malformed text returned `RPC_S_OK` where the runtime returns `RPC_S_INVALID_STRING_UUID`: - junk after the closing brace: `…abcde}junk` - a brace with no pair: `{…` or `…}` - doubled braces: `{{…}` - dashes missing or out of place The function's own comment ("the dashes in place") and the existing `garbage_is_refused` test show this text was meant to be refused. **Fix:** the text must be exactly `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`, optionally inside one pair of braces. Braces stay accepted, as the code and its test deliberately allow. `parse` has no other callers. **Test:** `malformed_guid_text_is_refused` covers 9 malformed strings. It fails before the change and passes after it (10 runs out of 10). The existing valid-GUID tests (upper case, braces, `A` and `W`) still pass. **Results:** - `cargo test -p victory-hle --locked`: 156 passed, 2 ignored. - `cargo clippy -p victory-hle --all-targets --locked --no-deps -- -D warnings` is clean, with and without `--all-features`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The parser skipped dashes wherever they stood and returned as soon as a
closing brace followed the 32nd digit. So text with junk after the brace
("...abcde}junk"), a brace without its pair, or dashes missing or out of
place parsed as a GUID and UuidFromStringA/W returned RPC_S_OK, where
the runtime returns RPC_S_INVALID_STRING_UUID. A title that checks a
string with UuidFromString took malformed text as valid.

The text is now exactly xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, optionally
inside one pair of braces, as the parser's comment already said. The new
test malformed_guid_text_is_refused fails before this change and passes
after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 13:38:13 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/261/head:github-bot/gh-261'
git switch 'github-bot/gh-261'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-261'
git switch 'github-bot/gh-261'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-261'
git switch 'github-bot/gh-261'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-261'
git switch 'main'
git merge --squash 'github-bot/gh-261'
git switch 'main'
git merge --ff-only 'github-bot/gh-261'
git switch 'main'
git merge 'github-bot/gh-261'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.