XGameUi: a Password text entry shows what is typed in clear text #881
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-24T13:17:32Z.
What's wrong
Microsoft's GDK documentation for
XGameUiTextEntryInputScopespecifies forPassword(31):In VIctory,
text_entry_asyncignores the input scope parameter (crates/victory-hle/src/modules/xgameui.rs:60,_scope: u32) and never passes it toask(crates/victory-hle/src/modules/xgameui.rs:66). The Win32 dialog template indialog::askalways builds the edit control withwm::WS_BORDER | tab | wm::ES_AUTOHSCROLL as u32(crates/victory-hle/src/modules/xgameui.rs:176-177), withoutES_PASSWORD.Concretely, calling
XGameUiShowTextEntryAsyncwithinputScope = 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
Passwordinput scope is unknown.Fix
Define
const PASSWORD: u32 = 31, passscope == PASSWORDintoaskaspassword: bool, and ORwindows_sys::Win32::UI::WindowsAndMessaging::ES_PASSWORDinto the edit control's window style whenpasswordis true (factored intodialog::edit_style(password: bool) -> u32and covered by a unit test). Open PR #370 also renames_scopetoscopeand definesconst PASSWORD: u32 = 31for length-limit handling; keeping the same parameter name and constant lets both changes combine cleanly sotext_entry_asyncpassesscopeto the limit logic andscope == PASSWORDtoask.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
mainffe310e,xgameui.rs+53/-8).Tests
a_password_entry_hides_what_is_typedchecks the edit-box style:password:WS_BORDER | ES_AUTOHSCROLL, noES_PASSWORD;ES_PASSWORD.On
main, the edit box is always built withoutES_PASSWORD, whatever the scope.On GitHub's
windows-latest, with the upstream CI's commands (clippy-D warningswith and without--all-features, thencargo test --workspace --locked): everything passes;victory-hle95 passed, 0 failed (https://github.com/BastienRodz/VIctory/actions/runs/45401505829).Not tested: the dialog shown interactively; a title that uses the
Passwordscope.No game data used. AI-assisted: found with GPT-6.2 Astra, written with Gemini 4 Neon, reviewed and verified with Claude Code.
Imported from Marvisak/VIctory. Originally posted by Sunkiller-qc on 2026-11-24T13:25:21Z.
Checked against main (
ffe310e), and it's real.text_entry_asynctakes the scope as_scope: u32and never uses it (xgameui.rs:60). The dialog's edit control is alwaysWS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL(xgameui.rs:176), with noES_PASSWORD.I also looked at the open PRs that touch
xgameui.rs. #370 renames it toscopeand addsPASSWORD = 31, but only uses it for the length limit. #519 and #237 leave_scopealone. 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.Imported from Marvisak/VIctory. Originally posted by MichaelSmithAI on 2026-11-24T13:31:08Z.
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.
Imported from Marvisak/VIctory. Originally posted by NATON4 on 2026-11-24T15:12:17Z.
Opened #1027 for this: one commit on
ffe310e,xgameui.rsonly. The scope reaches the dialog,Password(31) getsES_PASSWORD, other scopes keep the same edit box. Same names as #370 (scope,PASSWORD), so they combine. Thanks @BastienRodz for the report.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:58:48Z.
Automated triage for the maintainers.
Confirmed on
main: incrates/victory-hle/src/modules/xgameui.rs,text_entry_asyncnow usesscopeonly for the length limit (max_length_for), and the dialog inaskalways builds the edit box asWS_BORDER | tab | ES_AUTOHSCROLL, with noES_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