YesWiki Bazar CVE-2026-52772
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain saisie_formulaire admin credentials
-
DeliveryInject XSS payload into field label or hint
-
ExploitMalicious payload stored in form definition
-
ExecutionVictim visits page rendering poisoned form
-
Persist|raw filter bypasses Twig auto-escaping
-
ImpactXSS fires, steals victim session cookies
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The injection step requires authentication as a YesWiki administrator or as any user explicitly granted the saisie_formulaire ACL via config['permissions']['action']['saisie_formulaire'] - this ACL controls write access to form definitions per Guard.php:45-62 and is admin-only by default. Once the malicious payload is stored in the form definition, no authentication or special configuration is required for the XSS to fire against victims: any visitor - including unauthenticated guests - who loads a page that renders an affected Bazar form will trigger the payload. The label-body sink (layouts/input.twig:9, layouts/field.twig:5) fires on page parse with no user interaction required; the placeholder attribute sink (range.twig:19, email.twig:13) requires the victim to hover the input element, constituting a minor interaction prerequisite. The YesWiki instance must have at least one published Bazar form accessible to potential victims. Deployments that grant saisie_formulaire to non-admin user groups face a broader attacker population than the default configuration implies. An additional note from the advisory: on builds predating commit fe7244b (the imported-form authentication fix from 2026-05-12), the field.label and field.hint sources were reachable via unauthenticated POST to the imported-form handler, making the stored XSS unauthenticated on those older builds. |
| Impact | The CVSS 3.1 vector AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N calculates to a base score of 5.5 (Medium); the CVE description text cites 4.7, which appears to be a manual calculation error - 5.5 is mathematically correct for this vector and is used throughout this analysis. PR:H significantly bounds the attacker population: exploitation requires the saisie_formulaire ACL, which Guard.php:58-61 grants exclusively to administrators by default. However, S:C (Scope Changed) captures a meaningful asymmetry: a single privileged write operation poisons payloads that execute against every unauthenticated visitor of any published Bazar form, making the aggregate impact radius substantially larger than PR:H alone suggests. No EPSS score is available in the provided data, and no CISA KEV listing exists, so exploitation probability is not quantified by external measurement. That said, technical barriers to exploitation are low: the advisory provides exact payload strings, template line numbers, and rendered HTML, meaning an attacker with admin credentials faces no meaningful research burden. The advisory also identifies a second-order chaining risk - once XSS is established in the wiki origin, an attacker can harvest CSRF tokens and chain XSS to Path-Object Injection in BazarImportAction for potential RCE - which elevates operational priority on instances where saisie_formulaire is granted to non-admin user groups via config['permissions']['action']['saisie_formulaire']. |
| Exploit ScenarioDerived | An administrator logs into YesWiki, opens Bazar form management, and sets any field's hint value to "><script>alert(document.cookie)</script><span x= before saving the form; because layouts/input.twig is the base template extended by every Bazar field type, any unauthenticated visitor who subsequently loads any page rendering that form receives the injected script tag, which executes at parse time - before any user interaction - enabling session cookie theft or chained actions against the wiki origin. For the placeholder-attribute sink, a label containing hi" onmouseover="alert(1)" x= fires on hover of the range or email input. A detailed proof-of-concept covering all three sink classes, with exact payload strings and rendered HTML output, is confirmed in GHSA-xc7j-3g8q-9vh4. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 09, 2026
Stored XSS in YesWiki's Bazar form module allows a privileged form editor to inject persistent script payloads into field label and hint fields, which execute in the browser context of every subsequent visitor - including unauthenticated guests - who renders an affected form. The vulnerability is a sibling class of an incomplete fix at commit e6b66aa: that commit removed the dangerous |raw('html') filter from two Twig template call sites but left eleven additional sites in range.twig, email.twig, layouts/input.twig, layouts/field.twig, textarea.twig, user.twig, bookmarklet.twig, subscribe.twig, and linked-entry.twig still suppressing Twig's HTML auto-escaping. No active exploitation is confirmed in CISA KEV, but a detailed proof-of-concept with exact payloads, rendered HTML output, and affected line numbers is included in GitHub Security Advisory GHSA-xc7j-3g8q-9vh4, and patch commit 5d1a4d07 is publicly available.
RemediationAI
Apply patch commit 5d1a4d07fecb0706f33e5dfbbe6ff5ef1892b2a7 from the YesWiki repository at https://github.com/YesWiki/yeswiki/commit/5d1a4d07fecb0706f33e5dfbbe6ff5ef1892b2a7; a specific tagged release version containing this commit is not confirmed in the available data and should be independently verified against the repository before upgrading. The fix pattern established by e6b66aa - removing |raw so Twig's context-aware auto-escaper activates - must be applied class-wide across all eleven identified template locations: for attribute contexts (placeholder, title, alt), replace |raw('html')|striptags with |striptags|trim and remove the raw call; for label-body contexts using bare |raw inside label elements, either route field.label through HtmlPurifierService::cleanHTML() at construction in BazarField::__construct so downstream templates can emit already-sanitized HTML safely, or drop |raw entirely if labels are intended to be plain text. As an immediate compensating control on unpatched instances, restrict the saisie_formulaire ACL to the smallest possible set of fully trusted administrators via config['permissions']['action']['saisie_formulaire'] - this confines the attacker population to privileged accounts but does not eliminate the sink-side vulnerability. Adding a CI grep check for |raw('html') and |raw within tools/bazar/templates/ will prevent future reintroduction of the same pattern.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
YesWiki is a PHP-based wiki platform (pkg:composer/yeswiki_yeswiki) whose Bazar module provides a dynamic form builder rendered server-side via Twig templates. Twig's auto-escaping normally converts characters such as quote marks and angle brackets into HTML entities before emitting them into attribute or body contexts. This protection is bypassed when the raw('html') filter is applied: it wraps the value in a Twig Markup object, signalling the auto-escaper to emit the value verbatim. CWE-79 (XSS) is instantiated here via CWE-116 (Improper Encoding or Escaping of Output): field.label and field.hint - sourced from user-supplied form definitions via BazarField.php:46-53 - flow into Twig templates with |raw or |raw('html') applied, negating framework-level escaping. An aggravating factor is that field.label is constructed with html_entity_decode() at construction time, which actively converts entity-encoded payloads such as " back to raw quote characters, defeating any entity-encoding mitigation a form author might attempt. Three sink classes exist: (A) placeholder attributes using |raw('html')|striptags - striptags removes tags but not quote characters, enabling attribute breakout via event-handler injection; (B) title and alt attributes using |raw('html') without striptags - allows full script tag injection; (C) label-body contexts using bare |raw inside label elements - direct DOM injection with no filtering, firing on page parse without any user interaction.
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N
PR:H because saisie_formulaire is admin-only by default; UI:N because label-body sink fires on page load; S:C because payload executes in victim browser origin against all visitors.
Primary rating from Vendor (https://github.com/YesWiki/yeswiki).
CVSS VectorVendor: https://github.com/YesWiki/yeswiki
DescriptionCVE.org
Bazar form-field templates still apply |raw('html') to field.label / field.hint in attribute and label-body contexts - stored XSS in form renders (sibling class of commit e6b66aa)
CWE: CWE-79 (Improper Neutralization of Input During Web Page Generation, "Cross-site Scripting") via CWE-116 (Improper Encoding or Escaping of Output) - same class as the partial fix at commit e6b66aa
CVSS v3.1: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N → 4.7 (Medium)
(Privileges Required = High because writing the field definitions requires saisie_formulaire, which tools/bazar/services/Guard.php:58-61 grants only to admins by default; Scope = Changed because the XSS payload set by a form-editor admin executes in the origin context of arbitrary viewers, including unauthenticated visitors.)
Summary
Commit e6b66aa ("fix(bazar): leave the twig escape placeholder as is", 2026-05-19) recognised that emitting field.label through Twig's raw('html') filter into an HTML attribute is unsafe - Twig's raw marker suppresses the attribute auto-escape, striptags removes <…> tags but not ", so a label containing " can break out of the attribute and inject event-handler attributes. The commit fixed tools/bazar/templates/inputs/text.twig:19 and tools/bazar/templates/inputs/textarea.twig:3.
At least seven additional templates have the same pattern and were not touched by the fix:
tools/bazar/templates/inputs/range.twig:19-placeholder="{{ field.label|raw('html')|striptags }}"tools/bazar/templates/inputs/email.twig:13-placeholder="{{ field.label|raw('html')|striptags }}"tools/bazar/templates/layouts/input.twig:7-title="{{ field.hint|raw('html') }}" alt="{{ field.hint|raw('html') }}"tools/bazar/templates/inputs/textarea.twig:14- sametitle=/alt=pattern (the commit only fixed line 3, line 14 remains)tools/bazar/templates/inputs/user.twig:41, 55- sametools/bazar/templates/inputs/bookmarklet.twig:4- sametools/bazar/templates/layouts/input.twig:9,tools/bazar/templates/layouts/field.twig:5,tools/bazar/templates/inputs/subscribe.twig:16,tools/bazar/templates/inputs/linked-entry.twig:4,tools/bazar/templates/inputs/textarea.twig:16,tools/bazar/templates/inputs/bookmarklet.twig:6-{{ field.label|raw }}*outside* an attribute (label-body), with nostriptagsat all, so direct tag injection (<img src=x onerror=…>) executes
The layouts/input.twig and layouts/field.twig files are base layouts inherited by every Bazar field type, so a single malicious field.hint reaches into every form that uses that field.
Affected
- YesWiki
doryphoreat HEAD6c653dd(the audit checkout) - All releases that ship the listed templates with the
|raw('html')/|rawfilter in attribute or label-body context
Vulnerability details
[A] - Source: field.label and field.hint are populated from form definitions
tools/bazar/fields/BazarField.php:46-53:
$this->label = empty($values[self::FIELD_LABEL]) ? '' : html_entity_decode($values[self::FIELD_LABEL]);
$this->size = $values[self::FIELD_SIZE];
$this->maxChars = $values[self::FIELD_MAX_CHARS];
$this->default = $values[self::FIELD_DEFAULT];
$this->required = $values[self::FIELD_REQUIRED] == 1;
$this->searchable = $values[self::FIELD_SEARCHABLE];
$this->hint = $values[self::FIELD_HINT]; // [A] no decoding/escapingfield.label is html_entity_decode($values[FIELD_LABEL]) - the decode actively *turns* HTML-entity-encoded payloads (", ") back into raw ", defeating any entity-encoded mitigation a form author might apply. field.hint is the raw string from the form definition. Both flow into the field's __toString-like context unchanged. Form definitions are written by users with the saisie_formulaire ACL (tools/bazar/services/Guard.php:45-62 - admins by default; the same ACL the audit team chose to gate imported-form POST handling under in commit fe7244b).
[B] - Sink class 1: attribute-context |raw('html')|striptags (placeholder breakout)
tools/bazar/templates/inputs/range.twig:19:
placeholder="{{ field.label|raw('html')|striptags }}"tools/bazar/templates/inputs/email.twig:13:
placeholder="{{ field.label|raw('html')|striptags }}"raw('html') marks the value as a Markup object, which causes Twig's HTML auto-escaper to skip it (Twig\Markup::__toString). striptags removes <…> sequences but does not touch ", ', or =. A field.label of:
hi" onmouseover="alert(document.cookie)" x="passes striptags unchanged, is marked safe by raw('html'), and lands inside the attribute as:
placeholder="hi" onmouseover="alert(document.cookie)" x=""The injected onmouseover fires when a viewer hovers the input. Same vector as the pre-fix text.twig:19.
[C] - Sink class 2: attribute-context |raw('html') *without* striptags (worse)
tools/bazar/templates/layouts/input.twig:7:
{% if field.hint %}
<img loading="lazy" class="tooltip_aide" title="{{ field.hint|raw('html') }}" alt="{{ field.hint|raw('html') }}" src="tools/bazar/presentation/images/aide.png" width="16" height="16" />
{% endif %}Identical patterns in tools/bazar/templates/inputs/textarea.twig:14, tools/bazar/templates/inputs/user.twig:41, tools/bazar/templates/inputs/user.twig:55, tools/bazar/templates/inputs/bookmarklet.twig:4.
There is no striptags here at all, so the attacker has the full attribute-injection alphabet plus full HTML if the parser desynchronises. Setting field.hint = '"><script>alert(1)</script>' gives:
<img … title=""><script>alert(1)</script>" alt="…" …The <script> runs at page parse time. Because layouts/input.twig is extended by every field-type template, a single malicious field.hint on any field in any form propagates into every form render.
[D] - Sink class 3: label-body |raw (direct DOM injection)
tools/bazar/templates/layouts/input.twig:9:
{{ field.label|raw }}tools/bazar/templates/layouts/field.twig:5:
{%- block label -%}{{ field.label|raw }}{%- endblock -%}Plus subscribe.twig:16, linked-entry.twig:4, textarea.twig:16, bookmarklet.twig:6.
These are outside any attribute, in the body of a <label> element. raw suppresses escaping, there is no striptags. field.label = '<img src=x onerror=alert(1)>' injects an <img> tag straight into the label DOM; the onerror fires the moment the page renders, with no user interaction.
Why the fix at e6b66aa is incomplete
The fix correctly replaced field.label | raw('html') | striptags with field.label | striptags | trim (no raw) in text.twig's placeholder and textarea.twig's textarea placeholder. The fix is the right pattern - drop the raw so Twig's attribute-context autoescaper does its job - but it was applied at two specific call sites instead of being treated as a class-wide replacement. The siblings above use the same |raw('html')|striptags or |raw('html') idiom and are all currently exploitable.
Proof of concept
Setup
- Install YesWiki and log in as admin (or as any user with the
saisie_formulaireACL). - Navigate to *Bazar → Formulaires → Nouveau formulaire* and create a form. Add any field of type
range,email, or any other field type (every field type renders throughlayouts/input.twig, so thetitle=/alt=/ label-body vectors apply universally).
PoC 1 - range.twig placeholder attribute breakout (Sink class [B])
Set the field's label to:
Enter value" onmouseover="alert('XSS via field.label in range.twig')" x="Save the form. Have any visitor (including unauthenticated guests if the form is published) open a page that renders the form. Hovering the range input fires the injected handler.
Rendered HTML:
<input type="range" … placeholder="Enter value" onmouseover="alert('XSS via field.label in range.twig')" x="" required />PoC 2 - layouts/input.twig tooltip injection (Sink class [C])
Set the field's hint (Aide) to:
"><script>alert('XSS via field.hint in layouts/input.twig - fires on EVERY field type')</script><span x="Save. Any page that renders the form executes the script at parse time, before any user interaction. The vector is universal because layouts/input.twig is the base template extended by every field type.
PoC 3 - layouts/input.twig label-body injection (Sink class [D])
Set the field's label to:
<img src=x onerror="alert('XSS via field.label in layouts/input.twig')">Save. Page render fires the onerror immediately - no hover, no click, no striptags filter in the way.
Impact
Direct
- Stored XSS on every visitor of any Bazar form page - a privileged form editor injects script into a field's label/hint and the script runs in the wiki origin against every viewer of the form, including unauthenticated guests. Cookie theft, session hijack of any admin who visits, full content modification, phishing overlays.
- Universal sink in
layouts/input.twig- sinks [C] and [D] live in the base layout extended by every field type, so a single field with a malicious hint poisons every form render across the wiki, not just forms using a specific input type.
Indirect / second-order
- Privilege amplification despite
saisie_formulairebeing admin-only by default - many deployments grantsaisie_formulaireto specific user groups (per-deployment ACL configured viaconfig['permissions']['action']['saisie_formulaire']). For those deployments, the bug is exploitable by any user in those groups against any visitor. The audit pattern at commitfe7244b(the same team explicitly gatedimported-formPOST handling onsaisie_formulaire) demonstrates thatsaisie_formulaireis in fact a "trusted-input" boundary - outputs of that boundary should not assume HTML-safety. - Composability with the unpatched POI/CSRF in
BazarImportAction(reported separately as01-bazarimport-poi-csrf.md) - once any XSS exists in the wiki origin, an attacker can fetch a CSRF token (if added as part of the POI fix) and chain XSS → POI → RCE without needing to phish the admin onto a third-party origin. - The pre-
fe7244bwindow - for any deployment still running a build that predatesfe7244b(theimported-formauth fix from 2026-05-12), the source offield.label/field.hintwas reachable from unauthenticated POST to theimported-formhandler, making this finding unauth-stored-XSS on those builds. The current code path closes that source side, but reinforces that the sink-side fix ate6b66aashould be applied class-wide.
Suggested fix
Apply the same transformation e6b66aa applied to text.twig / textarea.twig placeholders, class-wide:
- For attribute contexts (
placeholder=,title=,alt=, etc.) - drop therawfilter. Let Twig's attribute-context autoescape handle the value:
placeholder="{{ field.label|striptags|trim }}"
title="{{ field.hint|striptags|trim }}"
alt="{{ field.hint|striptags|trim }}"striptags is fine to keep if there's a UX reason to strip incidental HTML; the security is in the absence of raw.
- For label-body contexts (
<label>{{ field.label|raw }}</label>) - decide which is the design intent and apply it everywhere: - If labels really need to render bold/italic/links: pass
field.labelthroughHtmlPurifierService::cleanHTML()at the point where the field object is constructed (i.e.BazarField::__construct's$this->label = …line), so any subsequent template emits already-purified HTML andrawbecomes safe. - If labels are plain text: drop the
rawfilter and let{{ field.label }}autoescape.
The label-body case in layouts/input.twig:9, layouts/field.twig:5, and the four inputs/*.twig files is the highest-impact patch target because it's reached by every field type; the attribute-context cases are more surgical.
Sweep target list (all in tools/bazar/templates/):
inputs/range.twig:19inputs/email.twig:13layouts/input.twig:7, 9layouts/field.twig:5inputs/textarea.twig:14, 16inputs/user.twig:41, 55inputs/bookmarklet.twig:4, 6inputs/subscribe.twig:16inputs/linked-entry.twig:4
A grep-driven CI check for |raw('html') and |raw inside Bazar twig templates would surface any future reintroduction.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.
Affected Products (CPE)CVE.org
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
GHSA-xc7j-3g8q-9vh4
NVD
CVE.org
EPSS
Exploit-DB