R I S K M O N I T O R

Loading

Intelligent Cybersecurity Check for vulnerabilities now

ARIA Prohibited Attribute Use

Rule ID: aria-prohibited-attr
Ruleset: axe-core 4.10
User Impact: Serious
Guidelines: WCAG 2.1 (A), WCAG 2.0 (A), WCAG 2.2 (A), EN 301 549


How to Fix the Problem

When ARIA attributes are applied to roles where they are explicitly prohibited, assistive technologies may ignore these attributes or behave inconsistently. This can confuse users who rely on screen readers or other assistive devices.

To resolve this:

  • Change the role: Use a different role that allows the specific ARIA attribute you are trying to use. For example, if aria-label is used on a role="none" or role="presentation" element (which prohibit it), consider using a different semantic role or native HTML element that inherently supports labels.

  • Use visible text instead: Sometimes the best solution is to communicate the information directly through visible text within the page content. This ensures that all users, including those using screen readers, receive the intended information.

  • Relocate the ARIA attribute: If the current element doesn’t support the attribute, you might move the attribute to a parent or sibling element with a compatible role.

Avoid trying to force communication via ARIA attributes on elements where such use is invalid—this typically backfires in accessibility outcomes.


Why it Matters

Using ARIA attributes inappropriately (on roles where they’re prohibited) may cause the information they are meant to convey to be entirely ignored by assistive technologies. Even worse, some technologies might attempt to interpret or compensate for the misuse, leading to unpredictable and confusing user experiences.

For example, in structures like treeitem, knowing the relationships—such as parents or siblings—is crucial for understanding the context. This can be conveyed correctly by:

  1. Proper DOM structure: Where the hierarchy is naturally represented.

  2. Valid ARIA use: Where additional ARIA attributes like aria-owns are used properly on permitted roles to enhance context.

Correct ARIA usage is key to ensuring that assistive technologies can provide consistent, reliable interpretations of a page’s structure and function.


Rule Description

This rule ensures that ARIA attributes are not used on roles that specifically disallow them. The WAI-ARIA specification defines a set of prohibited attributes for each ARIA role.

For instance, attributes like aria-label and aria-labelledby are not allowed on:

  • role="presentation" or role="none"

  • Text-like roles such as code, insertion, strong, etc.

Violating these restrictions results in a failure to convey the intended meaning to users relying on assistive technologies.


The Algorithm (in Simple Terms)

  1. For each element with an ARIA role:

  2. Check the attributes used on that element.

  3. Compare them against the list of ARIA attributes that are prohibited for that role (as defined by WAI-ARIA).

  4. If any prohibited attributes are found, flag a failure.

Leave A Comment