Fix: cover aria-roledescription/-placeholder/-valuetext/-keyshortcuts in attribute-injection-sanitize#186
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…uts in attribute-injection-sanitize These ARIA attributes surface to the accessibility tree as agent-readable name / description / value / shortcut text, so they're a quiet carrier for injection payloads. Pre-#176 they fell to hidden-text-strip's wrapper detachment; after #176 nothing was scrubbing them. Append the four names to CANDIDATE_ATTRIBUTES; the selector and scrub loop pick them up unchanged. Tests, property-test allowlist, and rule docs updated. Closes #182 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
e04bf74 to
9148204
Compare
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.
Summary
attribute-injection-sanitize'sCANDIDATE_ATTRIBUTESallowlist witharia-roledescription,aria-placeholder,aria-valuetext, andaria-keyshortcuts. These surface to the accessibility tree as agent-readable name / description / value / shortcut text, so a payload there is read by browser-use agents even when nothing is visibly rendered. Pre-Fix: scrub instead of detach for framework-rendered DOM #176 they fell tohidden-text-strip's wrapper detachment; after Fix: scrub instead of detach for framework-rendered DOM #176 nothing scrubbed them.attribute-injection-sanitize.test.tsit.eachcases (positive and clean-value) and the property-testALLOWLISTED_ATTRS/TAG_FOR_ATTRfixture set so fuzzing covers the new attributes against the shared injection fixture pack.docs/src/content/docs/rules.md"Scrub Attribute Injection" to enumerate the new attributes.Closes #182.
Test plan
bun run test— 1391 / 1391 passing.bun run check— biome + eslint clean.pre-commit run --files docs/src/content/docs/rules.md— mdformat / markdownlint pass.🤖 Generated with Claude Code