Repository navigation
fix: redact typed text when its field cannot be checked for a password - #616
Open
vishnuv688 wants to merge 2 commits into
Open
vishnuv688 wants to merge 2 commits into
vishnuv688 wants to merge 2 commits into
Conversation
Input masking learns a password by reading the field's type before the keys are sent. A read that failed, timed out or could not be issued counted as "not a password", so the typed value went to the dashboard and the trace in clear, with nothing logged. Every adapter now treats an unanswered read as a password field, by one shared decision (redactsTypedText, mirrored in Python and held to the typedSecret vectors), and warns once without naming the value. Redacting a value that was not a password is the safer error. Nightwatch and the WebdriverIO service's Appium direct probe answered failures with null or undefined rather than rejecting, so FIELD_TYPE_SCRIPT now returns '' for a match with no type and null only for no match, and both readers treat that null or undefined as no answer. Nightwatch's setPassword is taken as a password without a read, and a field located by neither CSS nor XPath counts as unanswered. Python, after one timed-out read, still stops reading on that session, and now redacts what it types there. Closes #600
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[High impact] The PR appears safe to merge; the latest test change matches the field-type script. SummaryThe PR redacts typed text when a field-type read fails, times out, or cannot be issued.
Reviews (2) · Last reviewed commit: "Let the fake field omit its type in the ..." · Reviewed by Greptile |
vishnuv688
added a commit
to webdriverio/webdriverio
that referenced
this pull request
Nov 26, 2026
…cted A typed value whose field-type read fails, times out or cannot be issued is now redacted rather than left as typed, with one warning that names no value, and Nightwatch's setPassword is taken as a password without a read. Matches webdriverio/devtools#616.
The test for a match that is not a form control passes a field with no type, which the FakeField interface rejected, so pnpm typecheck failed in the build job. Addresses review comments on #616
Member
Author
|
The Generated by Claude Code |
vishnuv688
added a commit
to webdriverio/webdriverio
that referenced
this pull request
Nov 26, 2026
#16503) * docs(devtools): document secret redaction and the new maskInputs scope * docs(devtools): align the limitations and Python variables with secret redaction * docs(devtools): a field that cannot be checked for a password is redacted A typed value whose field-type read fails, times out or cannot be issued is now redacted rather than left as typed, with one warning that names no value, and Nightwatch's setPassword is taken as a password without a read. Matches webdriverio/devtools#616.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #600.
With
maskInputson (the default), each adapter reads a field'stypebefore keys are sent and, for a password field, adds the typed value to the run's redaction set. When that read failed, timed out or could not be issued, the value was treated as "not a password" and reached the dashboard and the trace in clear, with nothing logged.This makes the read fail closed on all four adapters: an unanswered read counts as a password field, so the typed value is redacted, and the run logs one warning that never names the value. A read that answers with no type (an element that is not a form control) still keeps the text.
redactsTypedText(text, fieldType, answered)intyped-secrets.tsis the one decision.FIELD_TYPE_SCRIPTnow returns''for a match with no type andnullonly when nothing matched, so a reader can tell the two apart.noteTypedInputdistinguishes an unanswered read (rejected, timed out, or no reader) from an answered one, andconfigureSecretRedactiontakes an optional warning callback, which the WebdriverIO service, Selenium and Nightwatch pass their logger to.nullrather than rejecting, so its reader treatsnullas no answer.setPasswordis taken as a password without a read; a field located by neither CSS nor XPath, or with no selector, counts as unanswered.undefined, which now counts as no answer.redacts_typed_textmirrors the shared decision. A failed read is no longer indistinguishable from a field with no type, and a session that stopped reading after a timeout redacts what it types afterwards.Type of change
Packages touched
shared(types and contracts)core(framework-agnostic capture/reporting)elements(published element/snapshot API —@wdio/elements)service(WebdriverIO adapter)nightwatch-devtools(Nightwatch adapter)selenium-devtools(Selenium adapter)selenium-devtools-py(Selenium Python adapter)backend(server)app(UI)script(page-injected runtime)trace(Trace mode)Capability matrix
packages/conformance/src/features.tsupdated, and tables regenerated withpnpm docs:capabilities, if this adds or changes user-facing behaviourNo matrix change: the existing "Typed passwords and credential headers masked and redacted" feature covers it, and no cell's support level changes.
Notes for reviewers
@passwordis not CSS, so the script matches nothing and the value is redacted. Supporting page-object selectors in the read is a separate change.sharedandcore; each JS adapter only passes its logger, and Nightwatch and the service adapt their transport's failure value to a rejection, which only they know about. Python cannot import core, so it mirrors the decision, held to thetypedSecretvectors.pnpm build,pnpm test(345 files, 4714 tests, conformance rules included) andpnpm lint(0 errors) pass. The Python suite passes except two weak-reference tests intest_instrumentation.pythat fail the same way onmainunder local Python 3.12.Screenshots / recordings
Not a UI change.
🤖 Generated with Claude Code