티스토리 수익 글 보기
{{ message }}
Whitelist accessibility attributes (aria-*, role, tabindex) – #486
Merged
Conversation
Before this commit: `lxml.html.clean.Cleaner` strips all ARIA attributes (e.g., aria-label, aria-hidden, role) by default. This is because they are not included in the "safe attributes" whitelist. This behavior caused sanitized HTML to lose semantic meaning for assistive technologies (screen readers), making the output non-compliant with WCAG standards. After this commit: ARIA attributes are added to `defs.safe_attrs` so the Cleaner will no longer filter them out. This change ensures that developers using lxml for sanitization will not accidentally strip accessibility features while maintaining protection against XSS. Bug report: 2136144
Member
|
Thanks |
robinwhittleton
added a commit
to robinwhittleton/lxml
that referenced
this pull request
Mar 3, 2026
This was added in lxml#486, but was already in the set on line 49.
scoder
pushed a commit
that referenced
this pull request
Mar 27, 2026
This was added in #486, but was already in the set on line 49.
scoder
pushed a commit
that referenced
this pull request
Apr 17, 2026
Before this commit: `lxml.html.clean.Cleaner` striped all ARIA attributes (e.g., aria-label, aria-hidden, role) by default. This is because they were not included in the "safe attributes" whitelist. This behavior caused sanitized HTML to lose semantic meaning for assistive technologies (screen readers), making the output non-compliant with WCAG standards. After this commit: ARIA attributes are added to `defs.safe_attrs` so the Cleaner will no longer filter them out. This change ensures that developers using lxml for sanitization will not accidentally strip accessibility features while maintaining protection against XSS. Closes https://bugs.launchpad.net/bugs/2136144
scoder
pushed a commit
that referenced
this pull request
Apr 17, 2026
This was added in #486, but was already in the set on line 49.
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.
Before this commit:
lxml.html.clean.Cleanerstrips all ARIA attributes (e.g.,aria-label,aria-hidden,role) by default. This is because they are not included in the “safe attributes” whitelist. This behavior caused sanitized HTML to lose semantic meaning for assistive technologies (screen readers), making the output non-compliant with WCAG standards.After this commit:
ARIA attributes are added to
defs.safe_attrsso the Cleaner will no longer filter them out. This change ensures that developers using lxml for sanitization will not accidentally strip accessibility features while maintaining protection against XSS.