IA2: Do not treat huge base64 data as NVDA might freeze in Google Chrome (#10227)#10231
Conversation
006c574 to
5472fa7
Compare
|
It is not clear to me how this pr stops Chrome from crashing. |
Chrome does not crash. NVDA freezes. My bad, I rephrased the title. |
5472fa7 to
90fc104
Compare
|
As this would impact any Assistive Technology, I really think this should be reported to and fixed in both Firefox and Google Chrome itself. They should not be exposing data:image URIs via IAccessible2 attributes. |
I agree, despite someone might nitpick with a convoluted use case. Nevertheless, we should IMHO pragmatically implement this workaround (or another) in NVDA in the meantime. |
|
I don't think it will be too hard to do this also in the Gecko vbufBackend for this pr. |
That's fair. What would you prefer we exposed? The obvious solution is not to expose the src attribute at all in this case. On the other hand, the presence of the src attribute might be meaningful (i.e. this image came from a URL). |
|
I would say just stripping everything after the comma in all data uris
would be fine.
```
data:image/png;base64,blablablablablabla
```
becomes
```
data:image/png;base64
```
|
Review action nvaccess#10231 (comment)
…ome (#10227) - Py2 backport to beta (#10240) * IA2: Do not treat huge base64 data as NVDA might freeze in Google Chrome (#10227) * Refine comment Review action #10231 (comment)
@michaelDCurran, is there any chance that on the Python side As for the vbuf impact: |
|
@michaelDCurran, is there any chance that on the Python side
IAccessibleHandler.splitIA2Attribs also receive text of any kind?
This function is called to split an IAccessible2 attributes string,
either from IAccessible2::attributes or IAccessibleText::getAttributes.
I don't think there is a huge performance impact with running the regex
on both kinds of attributes strings. This function should never be run
on random text.
|
|
@michaelDCurran
I feel the first one ( |
… Google Chrome (PR nvaccess#10231) Ensure to truncate base64 data only in the `src` attribute, and not in an eventual text content (eg. in and inline editor). Re: nvaccess#10231 (comment)
… Google Chrome (PR nvaccess#10231) Ensure to truncate base64 data only in the `src` attribute, and not in an eventual text content (eg. in and inline editor). Re: nvaccess#10231 (comment)
… Google Chrome (PR nvaccess#10240) Ensure to truncate base64 data only in the `src` attribute, and not in an eventual text content (eg. in and inline editor). Re: nvaccess#10231 (comment)
… Google Chrome (PR #10231) (#10281) * Fix up of: IA2: Do not treat huge base64 data as NVDA might freeze in Google Chrome (PR #10231) Ensure to truncate base64 data only in the `src` attribute, and not in an eventual text content (eg. in and inline editor). Re: #10231 (comment) * Fix up of db3ec56: Include the comma after "base64" in the capturing group
… Google Chrome (PR #10240) (#10282) * Fix up of: IA2: Do not treat huge base64 data as NVDA might freeze in Google Chrome (PR #10240) Ensure to truncate base64 data only in the `src` attribute, and not in an eventual text content (eg. in and inline editor). Re: #10231 (comment) * Fix up of bd35387: Include the comma after "base64" in the capturing group
Link to issue number:
Python side of #10227
Summary of the issue:
Huge base64 embedded in the
srcattribute of animgelement can freeze Google Chrome.Description of how this pull request fixes the issue:
When the IA2 attribute string exceeds a threshold of 4096 characters, truncate the base64 from the text passed to
IAccessibleHandler.splitIA2Attribsbefore treating it.Testing performed:
Known issues with pull request:
The huge base64 is still uselessly present in the Virtual Buffer data.
The NVDAHelper thus would probably benefit from an impact on that regard.
Change log entry:
Section: Bug fixes
NVDA no longer crashes in Google Chrome when an image contains huge base64 data.