Skip to content

fix(web): never send a password typed inside an iframe to the authoring model - #797

Merged
HappyDevs1 merged 2 commits into
mainfrom
fix/iframe-password-scene
Nov 6, 2026
Merged

HappyDevs1 merged 2 commits into
mainfrom
fix/iframe-password-scene

Conversation

@HappyDevs1

Copy link
Copy Markdown
Collaborator

The bug

While recording with an AI provider configured, the engine sends a "scene" (the page's fields and labels, with their current values) to the authoring model. The page-level pass has always left password values out (fieldValue() skips type="password"). The same-origin iframe pass did not: it reported el.value for every field. So a password typed into a login form inside an iframe was sent to the AI provider, cut to 80 characters.

Found while building the "what leaves your machine" inventory for the security page (automators-com/flowproof-desktop#306).

How it was verified

  1. Reproduced locally by running SCENE_JS, taken verbatim from web.rs, in headless Chrome against a page with a password on the page and a login form in a titled srcdoc iframe, then typing a secret into both. The page password was absent from the scene, but the framed entry carried "text": "framed-secret-222".

  2. Fixed: the iframe pass now skips the value of input[type=password], the same rule as the page. The field stays in the scene with its target and label, so recording can still find and fill it.

  3. Re-tested locally: both secrets are absent from the scene, and the framed non-password field still reports its value (alice).

  4. CI, on purpose in two commits:

    • 7e1300e adds framed_scene_e2e.rs and wires it into the web E2E job. It should fail against the unfixed code.
    • The next commit is the fix, which should turn it green.

    The full-ci label is set so the web E2E job runs.

Also noticed (not changed here)

grid_scene_e2e.rs (which already asserts a page-level password stays out of the scene) and password_recording_e2e.rs are never run in CI. They return early unless FLOWPROOF_E2E=1, and no job lists them. Worth wiring up separately.

…cene

Fails on purpose: the same-origin iframe pass reports el.value for every
field, password included. The fix follows in the next commit.
@HappyDevs1 HappyDevs1 added the full-ci Run the full Windows build + E2E on this PR (off the PR path by default) label Nov 6, 2026
Copilot AI balanced review requested due to automatic review settings November 6, 2026 14:12
@HappyDevs1 HappyDevs1 added the full-ci Run the full Windows build + E2E on this PR (off the PR path by default) label Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

The page-level scene already skipped password values because the scene
travels to the authoring model; the same-origin iframe pass read el.value
for every field. framed_scene_e2e (previous commit) now passes.
@HappyDevs1
HappyDevs1 merged commit e465912 into main Nov 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run the full Windows build + E2E on this PR (off the PR path by default)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants