
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-52772 is a stored Cross-Site Scripting (XSS) vulnerability in YesWiki's Bazar module, where multiple Twig form-field templates apply the |raw('html') filter to field.label and field.hint values in both HTML attribute and label-body contexts without proper sanitization. A prior partial fix (commit e6b66aa, 2026-05-19) addressed only two specific template call sites (text.twig and textarea.twig placeholders), leaving at least seven additional templates exploitable. The vulnerability affects YesWiki versions prior to 4.6.6 (Composer package yeswiki/yeswiki). It was first published as a security advisory on June 2, 2026, and added to the GitHub Advisory Database on July 9, 2026. The CVSS v3.1 base score is 5.5 (Moderate) (GitHub Advisory, YesWiki Advisory).
The root cause is CWE-79 (Stored XSS) via CWE-116 (Improper Encoding or Escaping of Output). In BazarField.php, field.label is populated via html_entity_decode(), which actively converts entity-encoded characters (e.g., " → ") back to raw characters, defeating any entity-based mitigation. Both field.label and field.hint then flow unescaped into Twig templates that apply |raw('html'), which marks the value as a Twig\Markup object and suppresses Twig's HTML auto-escaper. Three sink classes exist: (B) attribute-context with |raw('html')|striptags — striptags removes <…> tags but not ", enabling attribute breakout via payloads like hi" onmouseover="alert(document.cookie)" x="; (C) attribute-context with |raw('html') and no striptags — allows full HTML injection via "><script>alert(1)</script>; and (D) label-body context with |raw and no filtering — allows direct DOM injection of arbitrary tags like <img src=x onerror=alert(1)>. The layouts/input.twig and layouts/field.twig base templates are inherited by every Bazar field type, meaning a single malicious field.hint propagates to every form render across the wiki (GitHub Advisory, YesWiki Advisory).
Successful exploitation results in stored XSS executing in the wiki's origin context against every visitor of any Bazar form page, including unauthenticated guests. Consequences include session cookie theft, admin session hijacking, full wiki content modification, and phishing overlay injection. Because the universal sink in layouts/input.twig is inherited by every field type, a single malicious field definition poisons all form renders site-wide. Additionally, the vulnerability is composable with a separately reported unpatched POI/CSRF in BazarImportAction, enabling an XSS → POI → RCE chain without requiring the attacker to phish an admin to a third-party origin (GitHub Advisory, YesWiki Advisory).
No public exploit kit or active in-the-wild exploitation has been reported. The EPSS score is 0.034% (11th percentile), indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Exploitation requires high privileges (saisie_formulaire ACL, granted to admins by default), though deployments that extend this ACL to non-admin user groups lower the effective privilege bar. A detailed proof-of-concept is included in the public advisory, covering both attribute-breakout and label-body injection vectors (GitHub Advisory).
saisie_formulaire ACL (configurable per deployment via config['permissions']['action']['saisie_formulaire']).range or email and set its label to: Enter value" onmouseover="alert(document.cookie)" x=". Save the form. When any visitor hovers the rendered input, the injected onmouseover handler fires."><script>alert('XSS')</script>. Save the form. Because layouts/input.twig is the base layout for every field type, this payload executes immediately on page load for every visitor of any form on the wiki, with no user interaction required.<img src=x onerror=alert(1)>. The |raw filter in layouts/input.twig:9 and layouts/field.twig:5 renders this tag directly into the DOM, firing onerror on page load./wakka.php?wiki=BazarListe&action=saisie_formulaire) containing URL-encoded XSS payloads in label or hint parameters (e.g., %22, onmouseover, onerror, <script>).onmouseover=, onerror=, <script>) in field label or hint fields.Upgrade to YesWiki version 4.6.6 or later, which applies the fix via commit 5d1a4d0. The patch sanitizes field.label at construction time in BazarField.php using HtmlPurifierService::cleanHTML() and removes the |raw('html') filter from attribute contexts across all affected templates (range.twig, email.twig, textarea.twig, user.twig, bookmarklet.twig, layouts/input.twig), replacing it with |striptags|trim. For label-body contexts, the fix relies on the upstream HtmlPurifierService sanitization so that |raw emits already-purified HTML. As a temporary workaround for sites that cannot upgrade immediately, restrict the saisie_formulaire ACL to the minimum necessary set of trusted administrators and audit existing form definitions for malicious label/hint values. Adding a CI grep check for |raw('html') and |raw inside Bazar Twig templates is recommended to prevent future reintroduction (GitHub Advisory, Fix Commit).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."