Drop virtual buffer attributes with invalid XML names #20629
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 470 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.368
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20629"
general
weight: 0.35
jcsteh
Link to issue number:
Fixes #7173
Summary of the issue:
Malformed markup can make a browser expose accessibility attribute names that are not valid XML names. For example,
<section aria-label"almenük">(note the missing=) yields an IA2 attribute name containing quote characters. NVDA stores virtual buffer fields as XML markup, so emitting such a name makes expat reject the buffer content: NVDA plays an error sound and cannot read the affected range in browse mode.Minimal test case (from @jcsteh), pasted into the Firefox address bar:
Description of user facing changes:
Browse mode now reads pages containing this kind of malformed markup normally; the broken attribute is ignored.
Description of developer facing changes:
VBufStorage_fieldNode_t::addAttributenow rejects attributes whose names are not valid XML names, returningfalse. This applies to all virtual buffer backends.Description of development approach:
Validation happens once, in
addAttribute, the attribute map's single insertion point, so the buffer only ever holds names that are valid in the XML it serializes to.isValidXMLAttribNameinnvdaHelper/common/xml.haccepts a conservative ASCII subset of XML names: the expat build Python ships enforces the stricter XML 1.0 fourth edition name rules, and every attribute name NVDA's Python code consumes is ASCII, so anything outside that subset can only be junk from broken markup. Because only valid names can reach the map,generateAttributesForMarkupOpeningTagnow writes stored names directly andsanitizeXMLAttribNameis deleted.Dropping the attribute extends the tradeoff made in #6249, which rewrote spaces in names to underscores: a readable buffer is worth more than preserving an attribute nobody can parse. The practical difference is that a name with invalid characters, such as a localised action name containing spaces, is now absent from the buffer instead of exposed under a mangled name. The well-known ASCII names NVDA itself consumes are unaffected.
An existing XML library was considered and rejected; see the review discussion below for the survey.
Testing strategy:
chrome_misc_ariaon windows-2025-vs2026,l10non windows-2022) each pass on the other OS in the same run, and master is currently red on two different system test suites, so both look like known runner flakiness rather than this change.Known issues with pull request:
None in the changed code. Two required system test jobs are red; see testing strategy.
Code Review Checklist:
- Change log entry
- User Documentation
- Developer / Technical Documentation
- Context sensitive help for GUI changes
- Unit tests
- System (end to end) tests
- Manual testing
- Speech
- Braille
- Low Vision
- Different web browsers
- Localization in other languages / culture than English
Notes on the checklist: a change log entry is included; no user or developer documentation or GUI help changes are needed. There is no unit test harness for the
vbufBaseC++ code; the change is a simple rejection at the buffer's insertion point, covered by the manual test case. Add-on facing behaviour changes only for attribute names that were never valid XML: they are now dropped instead of exposed under a sanitized name.