GHSA-r5xw-gcgw-hwp5 CVE-2026-52774
YesWiki Vulnerable to Reflected XSS via Unescaped `id` Parameter in Bazar Widget HTML Attributes
- Severity
- 6.1 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.66%
- Chance of exploitation in the next 30 days. Higher than 51.51% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-80 Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
- Fix
4.6.6- Upgrade yeswiki/yeswiki to this version or later
Description
Summary
YesWiki's Bazar widget handler reflects the id GET parameter into HTML attributes using strip_tags() only. Because strip_tags() does not escape double quotes, an attacker can break out of the attribute value, inject an event handler such as onmouseover, and execute arbitrary JavaScript in the victim's browser.
This issue is reachable without authentication. During validation, the vulnerable widget route returned the injected HTML for both /HomePage/widget?id=... and /NoSuchPage/widget?id=..., which shows that no login, no page ownership, no edit rights, and not even a valid page tag were required. The only routing prerequisite observed was that the Bazar extension is enabled and the request includes an id parameter.
Details
The primary sink is in tools/bazar/presentation/templates/widget.tpl.html around lines 4-7, where $_GET['id'] is inserted into the data-formid attribute:
data-formid="<?php echo strip_tags($_GET['id']); ?>"
strip_tags() is not an output-encoding function. It removes HTML tags, but it does not escape characters such as double quotes, so an attacker can terminate the data-formid attribute and inject new attacker-controlled attributes.
The route is served by tools/bazar/handlers/__WidgetHandler.php around lines 14-26, which only checks whether $_GET['id'] is present:
if (!isset($_GET['id'])) {
return null;
}
No HasAccess('read'), HasAccess('write'), or authentication check is performed before the vulnerable template is rendered.
There is also a second reflection path in the same handler. The handler builds:
$urlParams = 'id=' . strip_tags($_GET['id']) . ...
and then places the resulting value into the widget template's data-iframeUrl attribute:
data-iframeUrl="<?php echo $GLOBALS['wiki']->href('bazariframe', '', $urlparams, false); ?>"
During validation, a single payload injected into id was reflected into both data-formid and data-iframeUrl, which confirms that the handler exposes multiple attribute-level sinks from the same unsafely handled input.
This issue maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
PoC
- Set up a vulnerable YesWiki instance with the bundled Bazar extension enabled. This was validated locally on the official
doryphore 4.6.5release. - Confirm the minimum access requirements:
- No account is required.
- No
readorwritepermission on a specific page is required. - No valid existing page tag is required.
- No valid Bazar form identifier is required.
- The only observed requirements were that the Bazar widget handler is present and the request includes an
idparameter.
- Request the widget handler with an attribute-breaking payload in
id, for example:
http://127.0.0.1:8085/NoSuchPage/widget?id=%22%20onmouseover=%22alert(1)%22%20x=%22
- Open the URL in a browser as an unauthenticated visitor.
- Observe that the server returns HTTP
200and renders the Bazar widget page even though the page tag is arbitrary. - Inspect the returned HTML. The response contains attacker-controlled attributes in the widget root element:
<div id="widgetapp" v-cloak
data-formid="" onmouseover="alert(1)" x=""
...
data-iframeUrl="http://127.0.0.1:8085/NoSuchPage/bazariframe&id=" onmouseover="alert(1)" x=""
>
- Move the mouse over the
widgetappelement or otherwise trigger the injected event handler. - The browser executes the injected JavaScript in the YesWiki origin.
<img width="1600" height="838" alt="image" src="https://github.com/user-attachments/assets/de592586-a6ee-48f4-bbde-137ab07aaa71" />
Impact
This is a reflected XSS vulnerability in the Bazar widget handler with very low attacker prerequisites.
The practical access model is:
- The attacker only needs to send a crafted public URL.
- The victim does not need to authenticate.
- The attacker does not need edit rights, ownership, or a valid page tag.
- The route only needs to be reachable on a YesWiki instance with Bazar enabled.
An attacker may be able to:
- Execute arbitrary JavaScript in the victim's browser.
- Steal browser-accessible sensitive data.
- Perform actions in the victim's session if the victim is logged in.
- Target public visitors and authenticated users alike because the route is reachable without access-control checks.
Affected versions
Packagist
| Package | Vulnerable | Fixed in |
|---|---|---|
| yeswiki/yeswiki | < 4.6.6 |
4.6.6 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
yeswiki/yeswiki Packagist → 4.6.6
- composer
composer require yeswiki/yeswiki:^4.6.6
Severity breakdown
CVSS 3.1 6.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Weakness
CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.
How to prevent it
- Implementation: Carefully check each input parameter against a rigorous positive specification (allowlist) defining the specific characters and format allowed. All input should be neutralized, not just parameters that the user is supposed to specify, but all data in the request, including hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. We often encounter data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.
- Implementation: Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component. The problem of inconsistent output encodings often arises in web pages. If an encoding is not specified in an HTTP header, web browsers often guess about which encoding is being used. This can open up the browser to subtle XSS attacks.
- Implementation: With Struts, write all data from form beans with the bean's filter attribute set to true.
- Implementation: To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XmlHttpRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.
References
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-9369-69wj-7m2f YesWiki Vulnerable to Authenticated PHP Object Injection in BazarImportAction via unserialize | Critical | Also affects yeswiki/yeswiki |
| GHSA-4pf7-cc4r-g63h YesWiki has Authenticated SQL Injection via ReactionManager | High | Also affects yeswiki/yeswiki |
| GHSA-35f3-pg38-486f YesWiki Vulnerable to Reflected XSS via Unescaped Archived-Revision `time` Parameter in `handlers/page/show.php` | Medium | Also affects yeswiki/yeswiki |
| GHSA-xc7j-3g8q-9vh4 YesWiki has stored XSS in Bazar form-field templates via unescaped field.label / field.hint (|raw('html')) | Medium | Also affects yeswiki/yeswiki |
| GHSA-8f2v-2qhj-gfwg YesWiki: Second-Order SQL Injection in Page Delete API via Unescaped Page Tag (`ApiController::deletePage`) | High | Also affects yeswiki/yeswiki |
| GHSA-qg78-vmvc-fhjw YesWiki: SQL Injection possible through public Bazar entry-listing APIs via numeric `query`/`queries` filters | High | Also affects yeswiki/yeswiki |
| GHSA-vw42-752g-5mrp YesWiki has Unauthenticated Server-Side Request Forgery via ActivityPub `Signature.keyId` | High | Also affects yeswiki/yeswiki |
| GHSA-mv28-wj57-f57g YesWiki Vulnerable to Unauthenticated ActivityPub Signature-Verification Bypass via `!openssl_verify(...)` accepting `int(-1)` | High | Also affects yeswiki/yeswiki |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor