XGameUi: a Password text entry shows what is typed in clear text #881

Closed
opened 2026-11-26 04:14:06 +00:00 by github-bot · 4 comments
Owner

@⁠BastienRodz on GitHub · 2026-11-24 13:17 UTC · original

What's wrong

Microsoft's GDK documentation for XGameUiTextEntryInputScope specifies for Password (31):

This will be a fully localized keyboard where the textbox hides characters as the user types.

In VIctory, text_entry_async ignores the input scope parameter (crates/victory-hle/src/modules/xgameui.rs:60, _scope: u32) and never passes it to ask (crates/victory-hle/src/modules/xgameui.rs:66). The Win32 dialog template in dialog::ask always builds the edit control with wm::WS_BORDER | tab | wm::ES_AUTOHSCROLL as u32 (crates/victory-hle/src/modules/xgameui.rs:176-177), without ES_PASSWORD.

Concretely, calling XGameUiShowTextEntryAsync with inputScope = XGameUiTextEntryInputScope::Password (31) and typing "abc123" displays "abc123" in clear text instead of masking the characters.

Impact

Anyone looking at the screen sees a password a title asks the user to enter. Whether GTA VI uses the Password input scope is unknown.

Fix

Define const PASSWORD: u32 = 31, pass scope == PASSWORD into ask as password: bool, and OR windows_sys::Win32::UI::WindowsAndMessaging::ES_PASSWORD into the edit control's window style when password is true (factored into dialog::edit_style(password: bool) -> u32 and covered by a unit test). Open PR #370 also renames _scope to scope and defines const PASSWORD: u32 = 31 for length-limit handling; keeping the same parameter name and constant lets both changes combine cleanly so text_entry_async passes scope to the limit logic and scope == PASSWORD to ask.

The fix is ready on a branch of my fork, since PR creation is limited to collaborators: https://github.com/BastienRodz/VIctory/commits/hle/password-entry-hides-characters (one commit on main ffe310e, xgameui.rs +53/-8).

Tests

a_password_entry_hides_what_is_typed checks the edit-box style:

  • without password: WS_BORDER | ES_AUTOHSCROLL, no ES_PASSWORD;
  • with it: the same plus ES_PASSWORD.

On main, the edit box is always built without ES_PASSWORD, whatever the scope.

On GitHub's windows-latest, with the upstream CI's commands (clippy -D warnings with and without --all-features, then cargo test --workspace --locked): everything passes; victory-hle 95 passed, 0 failed (https://github.com/BastienRodz/VIctory/actions/runs/45401505829).

Not tested: the dialog shown interactively; a title that uses the Password scope.

No game data used. AI-assisted: found with GPT-6.2 Astra, written with Gemini 4 Neon, reviewed and verified with Claude Code.

**@⁠BastienRodz** on GitHub · 2026-11-24 13:17 UTC · [original](https://github.com/Marvisak/VIctory/issues/881) ## What's wrong Microsoft's GDK documentation for [`XGameUiTextEntryInputScope`](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgameui/enums/xgameuitextentryinputscope) specifies for `Password` (`31`): > This will be a fully localized keyboard where the textbox hides characters as the user types. In VIctory, `text_entry_async` ignores the input scope parameter (`crates/victory-hle/src/modules/xgameui.rs:60`, `_scope: u32`) and never passes it to `ask` (`crates/victory-hle/src/modules/xgameui.rs:66`). The Win32 dialog template in `dialog::ask` always builds the edit control with `wm::WS_BORDER | tab | wm::ES_AUTOHSCROLL as u32` (`crates/victory-hle/src/modules/xgameui.rs:176-177`), without `ES_PASSWORD`. Concretely, calling `XGameUiShowTextEntryAsync` with `inputScope = XGameUiTextEntryInputScope::Password` (`31`) and typing `"abc123"` displays `"abc123"` in clear text instead of masking the characters. ## Impact Anyone looking at the screen sees a password a title asks the user to enter. Whether GTA VI uses the `Password` input scope is unknown. ## Fix Define `const PASSWORD: u32 = 31`, pass `scope == PASSWORD` into `ask` as `password: bool`, and OR `windows_sys::Win32::UI::WindowsAndMessaging::ES_PASSWORD` into the edit control's window style when `password` is true (factored into `dialog::edit_style(password: bool) -> u32` and covered by a unit test). Open PR #370 also renames `_scope` to `scope` and defines `const PASSWORD: u32 = 31` for length-limit handling; keeping the same parameter name and constant lets both changes combine cleanly so `text_entry_async` passes `scope` to the limit logic and `scope == PASSWORD` to `ask`. The fix is ready on a branch of my fork, since PR creation is limited to collaborators: https://github.com/BastienRodz/VIctory/commits/hle/password-entry-hides-characters (one commit on `main` `ffe310e`, `xgameui.rs` +53/-8). ## Tests `a_password_entry_hides_what_is_typed` checks the edit-box style: - without `password`: `WS_BORDER | ES_AUTOHSCROLL`, no `ES_PASSWORD`; - with it: the same plus `ES_PASSWORD`. On `main`, the edit box is always built without `ES_PASSWORD`, whatever the scope. On GitHub's `windows-latest`, with the upstream CI's commands (clippy `-D warnings` with and without `--all-features`, then `cargo test --workspace --locked`): everything passes; `victory-hle` 95 passed, 0 failed (https://github.com/BastienRodz/VIctory/actions/runs/45401505829). **Not tested:** the dialog shown interactively; a title that uses the `Password` scope. No game data used. AI-assisted: found with GPT-6.2 Astra, written with Gemini 4 Neon, reviewed and verified with Claude Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:06 +00:00
Author
Owner

@⁠Sunkiller-qc on GitHub · 2026-11-24 13:25 UTC · original

Checked against main (ffe310e), and it's real. text_entry_async takes the scope as _scope: u32 and never uses it (xgameui.rs:60). The dialog's edit control is always WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL (xgameui.rs:176), with no ES_PASSWORD.

I also looked at the open PRs that touch xgameui.rs. #370 renames it to scope and adds PASSWORD = 31, but only uses it for the length limit. #519 and #237 leave _scope alone. So nothing open masks the input yet. And since your branch uses the same name and constant as #370, the two should combine without trouble.

**@⁠Sunkiller-qc** on GitHub · 2026-11-24 13:25 UTC · [original](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7132806660) Checked against main (`ffe310e`), and it's real. `text_entry_async` takes the scope as `_scope: u32` and never uses it (`xgameui.rs:60`). The dialog's edit control is always `WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL` (`xgameui.rs:176`), with no `ES_PASSWORD`. I also looked at the open PRs that touch `xgameui.rs`. #370 renames it to `scope` and adds `PASSWORD = 31`, but only uses it for the length limit. #519 and #237 leave `_scope` alone. So nothing open masks the input yet. And since your branch uses the same name and constant as #370, the two should combine without trouble.
Author
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-24 13:31 UTC · original

Melissa checked the actual Win32 edit control on your a4bafe5 branch under Wine 11.22, with an isolated prefix and Xvfb display. The test opened the dialog through the guest async text-entry method. EM_GETPASSWORDCHAR returned a nonzero masking character for Password (31) and zero for ordinary text (0). After the test entered the same synthetic ten-character string and accepted each dialog, the async result returned that string and reported 11 bytes including the terminator in both cases.

All three focused XGameUi checks passed. A local combination with #370 also passed all four focused checks, including its length-limit test. With a requested maximum of 16 for both scopes, EM_GETLIMITTEXT on the live control returned 16 for ordinary text and 1024 for Password. The dialog was driven programmatically; this verifies the control setting and returned text on Wine. GTA VI use of Password scope remains unknown.

**@⁠MichaelSmithAI** on GitHub · 2026-11-24 13:31 UTC · [original](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7132945015) Melissa checked the actual Win32 edit control on your a4bafe5 branch under Wine 11.22, with an isolated prefix and Xvfb display. The test opened the dialog through the guest async text-entry method. EM_GETPASSWORDCHAR returned a nonzero masking character for Password (31) and zero for ordinary text (0). After the test entered the same synthetic ten-character string and accepted each dialog, the async result returned that string and reported 11 bytes including the terminator in both cases. All three focused XGameUi checks passed. A local combination with #370 also passed all four focused checks, including its length-limit test. With a requested maximum of 16 for both scopes, EM_GETLIMITTEXT on the live control returned 16 for ordinary text and 1024 for Password. The dialog was driven programmatically; this verifies the control setting and returned text on Wine. GTA VI use of Password scope remains unknown.
Author
Owner

@⁠NATON4 on GitHub · 2026-11-24 15:12 UTC · original

Opened #1027 for this: one commit on ffe310e, xgameui.rs only. The scope reaches the dialog, Password (31) gets ES_PASSWORD, other scopes keep the same edit box. Same names as #370 (scope, PASSWORD), so they combine. Thanks @⁠BastienRodz for the report.

**@⁠NATON4** on GitHub · 2026-11-24 15:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7135630346) Opened #1027 for this: one commit on `ffe310e`, `xgameui.rs` only. The scope reaches the dialog, `Password` (31) gets `ES_PASSWORD`, other scopes keep the same edit box. Same names as #370 (`scope`, `PASSWORD`), so they combine. Thanks @⁠BastienRodz for the report.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:58 UTC · original

Automated triage for the maintainers.

Confirmed on main: in crates/victory-hle/src/modules/xgameui.rs, text_entry_async now uses scope only for the length limit (max_length_for), and the dialog in ask always builds the edit box as WS_BORDER | tab | ES_AUTOHSCROLL, with no ES_PASSWORD, so a Password entry is shown in clear text. Open PR #2067 (fuzeofficlal) masks it; #1027, which carried the same change, was closed unmerged. Whether the title ever asks for a Password entry is not known.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:58 UTC · [original](https://github.com/Marvisak/VIctory/issues/881#issuecomment-7155358027) <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-24T15:12:17Z at=2026-11-25T06:58:47Z --> Automated triage for the maintainers. Confirmed on `main`: in `crates/victory-hle/src/modules/xgameui.rs`, `text_entry_async` now uses `scope` only for the length limit (`max_length_for`), and the dialog in `ask` always builds the edit box as `WS_BORDER | tab | ES_AUTOHSCROLL`, with no `ES_PASSWORD`, so a Password entry is shown in clear text. Open PR #2067 (fuzeofficlal) masks it; #1027, which carried the same change, was closed unmerged. Whether the title ever asks for a Password entry is not known. --- _Generated by [Claude Code](https://claude.ai/code)_
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/Marvisak--VIctory#881
No description provided.