Skip to content

Audit INJECTION_PATTERNS coverage on attribute-targeted rules post-#176 #179

@twschiller

Description

@twschiller

Follow-up to #176.

Before #176, hidden-text-strip detached the entire hidden wrapper, which took image alt, aria-label, title, SVG <title> / <desc>, and data-* attributes with it. After #176 it only blanks Text nodes inside the hidden subtree. Attribute-shaped payloads inside a hidden box are now only caught by attribute-targeted rules — primarily attribute-injection-sanitize and svg-text-stripif they match those rules' pattern sets.

In other words: hidden-text-strip is no longer back-stopping attribute-shaped injections inside hidden boxes. The broad "wipe everything inside the box" sweep is gone.

What to audit

Walk every rule that scrubs attribute or text content based on INJECTION_PATTERNS (extension/src/rules/injection-patterns.generated.ts) and check whether its match shape covers the payload classes that previously fell to hidden-text-strip's wrapper removal:

  • attribute-injection-sanitize — does it catch alt, aria-label, title, data-* consistently across element types?
  • svg-text-strip — covers SVG <title> / <desc> text; does it also cover SVG attribute payloads?
  • Any others that read INJECTION_PATTERNS?

For each gap found, decide: extend the pattern set, extend the rule's selector, or accept and document.

Acceptance

  • Inventory of attribute-shaped payload classes formerly caught only by hidden-text-strip.
  • For each class: which rule (if any) covers it now, and what the gap is.
  • Filed individual issues or pattern additions for confirmed gaps.

Out of scope

  • meta-injection-strip / noscript-strip watcher gaps — tracked separately.
  • html-comment-strip broad-sweep restoration — tracked separately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions