omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Password preedit text is shown in plaintext on lock screen / polkit prompts when an IME is active

Open Rhytam23 opened this issue 2 months ago • 2 comments

System details

omarchy (current default branch / 4.0.4-1)

What's wrong?

When an input method (fcitx5, ibus, or any IME with composition/preedit enabled) is active while typing into a password field — the lock screen unlock field, the Wi-Fi passphrase field, or the Polkit (sudo) authentication prompt — the character(s) currently being composed are shown in plaintext by the input method's own preedit/candidate popup, even though the field itself is masked (dots/bullets).

This looks like the same symptom reported in #12727 ("password becomes visible when unlocking"), with a likely root cause identified there.

Why this happens

TextInput.Password (and Ui/TextField's password mode) only mask committed text. They do nothing to an input method's preedit/composition buffer — an active IME draws that separately, in plaintext, regardless of the field's echo mode. Qt suppresses this only when the field sets inputMethodHints to include Qt.ImhSensitiveData | Qt.ImhHiddenText | Qt.ImhNoPredictiveText.

None of the shell's password fields set inputMethodHints:

  • shell/plugins/lock/LockView.qml (lock screen password)
  • shell/Ui/TextField.qml (shared password-mode field, e.g. Wi-Fi passphrase)
  • shell/plugins/polkit/PolkitAgent.qml (sudo/polkit prompt)

This is more likely to be hit now that fcitx5 is seeded as the default input method, so more users have an active IME on the lock screen.

To reproduce

  1. Enable fcitx5 or ibus with composition/preedit enabled.
  2. Lock the screen (or trigger a polkit auth prompt).
  3. Focus the password field and start typing.
  4. Observe the IME's preedit/candidate popup rendering the typed characters in plaintext, even though the field itself shows masked dots.

Suggested fix

Set inputMethodHints: Qt.ImhSensitiveData | Qt.ImhHiddenText | Qt.ImhNoPredictiveText on each password field above. See #13001 for a draft fix.

Rhytam23 avatar Sep 23 '26 04:09 Rhytam23

Closing: the root cause proposed here (missing inputMethodHints) is wrong. Qt already applies SensitiveData/NoPredictiveText for password echo modes, so setting them changes nothing (see the correction on #13001). Please track this on #12727, which is still unreproduced.

Rhytam23 avatar Sep 24 '26 14:09 Rhytam23

Note for whoever picks this up: explicitly setting inputMethodHints on the Password fields does not change anything. Qt 6.11's effectiveInputMethodHints() clears ImhHiddenText in Password mode (and adds Sensitive/NoPredictive/NoAutoUppercase itself), so the effective hints are identical with or without the declaration — I verified this against the Qt 6.11.2 source and closed #13128 as a no-op. The same function keeps ImhHiddenText for NoEcho fields, so a NoEcho field with a separately drawn mask may be the more promising direction, but it needs live IME verification.

anandude avatar Sep 25 '26 04:09 anandude