Mobile nav dropdown aria-label can be corrupted by third-party wp_kses_allowed_html filters
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
The mobile sidebar dropdown toggle button's aria-label is built using wp_filter_nohtml_kses(), which is not resilient to third-party plugins that hook wp_kses_allowed_html incorrectly. When such a plugin adds allowed tags without respecting WordPress's reserved 'strip' context, the wrapper Neve adds around the menu title survives instead of being stripped, producing a corrupted, HTML-tag-filled aria-label on every dropdown menu item.
Steps to reproduce:
- Activate Neve, create a menu with at least one item that has children (e.g. "Shop" with a submenu), assign it to the Primary location.
- Install and activate the "Booster for WooCommerce" plugin (woocommerce-jetpack) — any recent version.
- View the mobile menu markup (view-source, or inspect the dropdown toggle button for "Shop").
Expected:
<button ... aria-label="Toggle Shop">
Actual:
<button ... aria-label="Toggle <span class=\"menu-item-title-wrap dd-title\">Shop</span>">
Root cause:
nav_walker.php:154:
$toggle_aria_label = __( 'Toggle', 'neve' ) . ' ' . wp_filter_nohtml_kses( $title );
$title at this point already contains our own ... wrapper (added a few lines earlier). We rely on wp_filter_nohtml_kses() to strip it back down to plain text before using it as an attribute value.
wp_filter_nohtml_kses() is a core WP function whose own docblock says "This function expects slashed data" — it's designed for sanitizing raw form/DB-bound input, not for stripping tags out of HTML we built ourselves. Internally it calls wp_kses( $data, 'strip' ), and that 'strip' context is passed through the public, pluggable wp_kses_allowed_html filter. Any plugin that hooks that filter and adds tags without checking $context === 'strip' will cause tags to survive a call that's supposed to guarantee zero tags. (Confirmed: Booster for WooCommerce's wcj_add_allowed_html() does exactly this.)
The value does get passed through esc_attr() before being output, so this isn't an XSS/broken-HTML issue — but it's a real accessibility regression (screen readers announce raw markup instead of the menu label) and is visible to anyone inspecting the DOM or running an accessibility audit.
Suggested fix:
Use wp_strip_all_tags() instead, since it does a plain string-based tag strip and never touches the wp_kses_allowed_html filter chain:
$toggle_aria_label = __( 'Toggle', 'neve' ) . ' ' . wp_strip_all_tags( $title );
This makes the dropdown toggle immune to this entire class of third-party filter conflicts, regardless of what any given plugin does wrong.
Severity: Low visual/security impact (escaped output), but a real accessibility bug and a support-burden source, since it presents as "menu looks broken" reports that are hard for less technical users/reporters to diagnose as a plugin conflict.
- Lenguaje dominante
- PHP
- Estrellas
- 307
- Forks
- 89
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Codeinwp/neve
-
bug-report bug-report-triage crash-report
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Los mantenedores suelen responder en 1 día
-
Duplicate H1: hidden screen-reader title H1 rendered alongside custom layout H1 when page title is hiddenPosiblemente ocupada @HardeepAsrani la tomó hace 16 días. Abiertobug-report bug-report-triage customer report
Dificultad 4/5 1-2 días Aptitud para principiantes 48/100
Codeinwp/neve#4652 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Enhance home screen and front page customization options in Neve FreePosiblemente ocupada @faisalahammad la tomó hace 7 días. Abiertofeature-request-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Add basic Social Icons component to free Header and Footer builderPosiblemente ocupada @faisalahammad la tomó hace 7 días. Abiertofeature-request-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
customer report feature-request-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
Todos los issues de Codeinwp/neve
Issues similares
-
L: javascript
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dependabot/dependabot-core#16744 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
linuxserver/docker-bookstack#302 · 1 comentario ·
-
Dificultad 2/5 Menos de una hora Aptitud para principiantes 62/100
OpenConext/OpenConext-devconf#101 ·
-
component/document-portal domain/b2b
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día