-
Notifications
You must be signed in to change notification settings - Fork 849
Description
Product: axe-core
Summary: When axe-core's default frameMessenger hits a postMessage error, it results in an Error leaking from await axe.run(), where it would ideally instead result in the scan completing with a frame-tested violation for the frame in question.
Some specific variants that can trigger the issue:
- A
file://url that embeds an iframe which axe-core could normally reach will emit an error with messageallowedOrigins value "null" is not a valid origin - Any page that embeds an iframe which the browser prevents cross-origin access to (eg, a
file://url that embeds anhttps://page) will emit aSecurityErrorwith messageBlocked a frame with origin "null" from accessing a cross-origin frame.- In Chromium, the message is
Blocked a frame with origin "null" from accessing a cross-origin frame. - In Firefox, the message is
Permission denied to access property "DOMException" on cross-origin object
- In Chromium, the message is
Repro steps:
- Download this self-contained repro gist to a local html file
- Open it via a
file:///url - Click the two "scan" buttons
- Observe the errors displayed in the
<textarea>
Expectation: if the scan context includes iframes which the default postMessage implementation cannot communicate with, it should result in scans which complete with frame-tested violations, not errors emitted from await axe.run()
Actual: await axe.run() emits Errors in the two variants from the repro file
Motivation: Caused a regression in one of our sample projects when upgrading from 4.1.x to 4.2.x, see TroyWalshProf/SeleniumAxeDotnet#154 and microsoft/axe-pipelines-samples#552.
axe-core version: 4.2.2
axe-webdriver, extension or other integration version: n/a
Browser and Assistive Technology versions:
* Browser versions: repros under each of the following:
* Microsoft Edge Version 91.0.864.48 (Official build) (64-bit)
* Google Chrome Version 91.0.4472.106 (Official Build) (64-bit)
* Firefox 89.0 (64-bit)
* **Note: SecurityException variant works manifests slightly differently in Firefox vs Chromium**
* AT versions: n/a