Skip to content

[Bug] Overly aggressive secret redaction corrupts a11y snapshot labels and attributes #1106

Closed

Description

@ogadra

Summary

The _redactSecrets function indiscriminately redacts any occurrence of a secret's value across the entire a11y snapshot. This leads to the corruption of non-input text, such as labels and attributes, whenever they contain a substring that matches a secret.

Example

Configure secrets such as:

  • PASSWORD=ssw (short value)
  • or PASSWORD=e2

Generate an a11y snapshot containing a textbox labeled:

  • textbox "Password" [ref=e24]:

Observe the redaction result:

  • With PASSWORD=ssw:
    textbox "Pa<secret>PASSWORD</secret>ord" [ref=e24]:
  • With PASSWORD=e2:
    textbox "Password" [ref=<secret>PASSWORD</secret>4]:
    These substitutions happen even though the secret appears only as a substring of unrelated text/attributes.

Expected behavior

  • Redact only the concrete input values that were filled from secrets (e.g., textbox … textInput: "•••"), or otherwise ensure redaction respects value boundaries and context so that labels/attributes are unaffected.

Impact

Short secrets (e.g., CVV codes) are prone to substring collisions, leading to the widespread masking of unrelated text and the corruption of a11y tree data.

Question

Can we scope redaction exclusively to input values (e.g., the textInput portion) instead of the entire a11y snapshot?

Activity

  1. pavelfeldman commented on Oct 3, 2025

    @pavelfeldman
    Member

    Redact only the concrete input values that were filled from secrets (e.g., textbox … textInput: "•••"), or otherwise ensure redaction respects value boundaries and context so that labels/attributes are unaffected.

    Can't do that, secrets are secrets and they can appear anywhere, in custom controls, etc. We need to redact. If your secret is "Password", it is not a secret, please don't use the secrets feature for guessable content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions