Skip to content

integrity controls: residual reads past the attribute cap and unpinned budget limits #1559

Closed

Description

@nc9

Follow-ups from the independent review of #1538 (reworked head 9cb20e5). Nothing here is a regression; each is a way a page can still keep an integrity rule from reading a real control without the result looking clean, or a claim that needs pinning.

  • A control with more than 4,096 attributes is counted in controlsUnread and the page gets an info note, but its href and cue attributes are not read. A second pass over attributes past 4,096 that reads only href and the cue names (charged to the work budget) would close it. The cost to an attacker is about 20 KB of valueless attributes.
  • integrity/obfuscated-script still says only "single signal, review" when a link was cut, with no truncation note, where brand-impersonation carries scanTruncated and controlsUnread.
  • aria-labelledby with more than 16,000 leading spaces before the id is silently not read (16,000-character slice).
  • Test pins missing: the target-budget check boundary (>= versus > at an exact landing), a cached target re-read after the budget is spent, and integrityCounters.enabled defaulting off (the "off in production" claim is untested).
  • The documented limit "at most 300,000 target visits" is off by up to 255, because the check runs before each read.

Acceptance Criteria

  • A control with more than 4,096 attributes has its href and cue attributes read by a bounded second pass, or the docs state that they are not read and the result carries a visible truncation note
  • obfuscated-script carries a truncation note when a link was cut, as brand-impersonation does
  • An aria-labelledby value with more than 16,000 leading spaces is either read or counted as unread
  • Tests pin the target-budget boundary, a cached target re-read after the budget is spent, and integrityCounters.enabled being off by default
  • The documented visit limit states the real bound (300,000 plus at most 255)

Activity

  1. added
    enhancement
    size: S
    rules
    on Nov 2, 2026
  2. added theissue type on Nov 2, 2026
  3. nc9 commented on Nov 4, 2026

    @nc9
    ContributorAuthor

    Acceptance check against v0.0.162 (7c31d5b, release). Fix commit: 0f4ea3f. Tests run on the tag: packages/rules/tests/integrity-residual-1559.test.ts 14 pass, integrity-attribute-budget-1462.test.ts 13 pass.

    # Criterion Result Evidence
    1 More than 4,096 attributes: second pass or docs and a visible note PASS controls.ts readControlAttributes(el, room) reads past the 4,096th, charged to the page budget; "a control with more than 4,096 attributes (second pass)" tests the read, the room bound (what the budget cannot cover is still counted overlong) and first-name-wins
    2 obfuscated-script truncation note PASS obfuscated-script.ts adds the note and details.scanTruncated; "integrity/obfuscated-script says when a link was cut" (with a no-note control); docs updated
    3 aria-labelledby with more than 16,000 leading spaces read or counted PASS ids are read from the first non-space character, an id left past the slice is counted unread; "aria-labelledby padded with spaces"
    4 Tests pin target-budget boundary, cached re-read, integrityCounters.enabled off PASS "exactly 300,000 visits spent ... (>=, not >)" and its one-visit-short counterpart, "a target read before the budget was spent is reused after it", "it is disabled when the module is loaded"
    5 Documented visit limit states the real bound PASS docs/rules/integrity/brand-impersonation.mdx and the CHANGELOG: "at most 300,000 visits in all, plus at most 255"

    All five boxes are ticked. Closing.

    nik

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

    enhancementrulessize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions