Skip to content

a password is typed only into a password box, and nothing is submitted when one would land elsewhere - #382

Merged
hexuria merged 1 commit into
mainfrom
gol/fill-right-box
Oct 10, 2026
Merged

hexuria merged 1 commit into
mainfrom
gol/fill-right-box

Conversation

@hexuria

@hexuria hexuria commented Oct 10, 2026

Copy link
Copy Markdown
Owner

The bug

On 10 Oct 2026 a saved-login fill on Facebook typed the password into the email box, where it showed in plain text, and pressed Log in, sending it as the username. fill_into_focus reaches each field by clicking where the model said it is, or by Tab, and then types without checking where focus actually landed.

The fix

Needs hexuria/box#38. The box now says what kind of box has focus (focus and seq in GET /v1/chrome/active-tab).

  • opengrok-box: new Computer::focused_field returning a Focus {kind, seq}. By default it errors, meaning the computer can't say. The docker box reads it from the active-tab report (focus_in); an image from before the report has no seq, so it can't say.
  • opengrok-forms fill_into_focus: before typing a password (type password, or marked secret, but not an otp code), it reads the report from before reaching the field. After the click or Tab, it waits up to 1.5 s for a fresh report, then types only if the focused box is a password box.
    • If the box is anything else, or the computer can't say, the password is not typed, that field and the rest are fill_failed, and so Return is never pressed.
    • Values that aren't passwords are typed as before.

Deploy note: a server with this change and a box image from before #38 refuses every password fill, failing closed, until the image is rebuilt.

Tests

  • New: a_password_whose_click_lands_on_the_email_box_is_not_typed. The 10 Oct case: the password's position lands on the email box. The email is typed, the password never is, and nothing is submitted.
  • New: a_computer_that_cannot_say_which_box_has_focus_types_no_password.
  • Both fail without the fix: run against the old fill_into_focus, 2 tests fail. With the fix, all 27 fill tests pass.
  • The unit tests' FillSpy now models a page: a click or Tab moves focus, and it reports the focused box's kind. The existing password tests got pages that match their forms.
  • against_user_form's stub reports a password box after every action. Those tests cover who may fill and where; the focus rule is the unit tests' to prove.
  • New: the_focused_box_is_read_from_the_active_tab_report, against the exact JSON the new box image answered live.
  • Full workspace: 1953 passed. Clippy -D warnings, fmt and the crate-size check are clean.

Live check

The box half was checked live in a container built from hexuria/box#38 (see that PR): text → password → none → password as focus moved. A full fill on a Bot's computer needs that image on the Bot's computer; to do after #38 merges.

@hexuria
hexuria merged commit d6f30d2 into main Oct 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant