Skip to main content
Vulnerability Database/CVE-2025-46350

CVE-2025-46350: Yeswiki Yeswiki Reflected XSS Vulnerability

CVE-2025-46350 is a reflected cross-site scripting vulnerability in Yeswiki that enables attackers to steal cookies and hijack user sessions through malicious links. This article covers technical details, affected versions, potential impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-46350 Overview

CVE-2025-46350 is a reflected cross-site scripting (XSS) vulnerability in YesWiki, an open-source wiki system written in PHP. The flaw exists in versions prior to 4.5.4 and stems from improper validation of the incomingurl request parameter in the page deletion handler. An attacker can craft a malicious link that, when clicked by an authenticated user, executes arbitrary JavaScript in the victim's browser context. Successful exploitation allows attackers to steal session cookies, hijack authenticated sessions, deface wiki pages, or embed malicious content. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Attackers can hijack authenticated user sessions by tricking privileged users into clicking a crafted URL, leading to full account takeover within the YesWiki instance.

Affected Products

  • YesWiki versions prior to 4.5.4
  • YesWiki deployments using the handlers/page/deletepage.php handler
  • All PHP-based YesWiki installations exposing the affected incomingurl parameter

Discovery Timeline

  • 2025-04-29 - CVE-2025-46350 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-46350

Vulnerability Analysis

The vulnerability resides in the YesWiki page deletion handler located at handlers/page/deletepage.php. The handler reads the incomingurl parameter directly from the request and passes it through urldecode() without validating that the value is a legitimate URL. This decoded, attacker-controlled value is later reflected into the response, allowing arbitrary HTML and JavaScript to execute in the victim's browser. Because exploitation requires an authenticated user with elevated privileges to click a crafted link, the attack combines social engineering with reflected script injection. Once the payload runs, the attacker inherits the session context of the victim, enabling cookie theft, content defacement, and unauthorized administrative actions within the wiki.

Root Cause

The root cause is missing input validation on a user-controlled parameter that is trusted as a URL. The original code used urldecode($_GET['incomingurl']) without confirming the value conformed to a valid URL structure or sanitizing dangerous characters. This oversight allowed script payloads to survive reflection into the HTTP response and execute in the browser rendering context.

Attack Vector

Exploitation requires an attacker to deliver a crafted URL to an authenticated YesWiki user, typically through phishing, chat platforms, or embedded links. When the victim clicks the link while logged in, the payload executes in their browser session. The attacker can exfiltrate session cookies to a controlled endpoint, replay them to impersonate the user, and perform actions the victim is authorized to execute.

php
// Security patch in handlers/page/deletepage.php
// get the GET parameter 'incomingurl' for the incoming url
if (!empty($_REQUEST['incomingurl'])) {
-    $incomingurl = urldecode($_GET['incomingurl']);
+    $incomingurl = filter_var($_REQUEST['incomingurl'], FILTER_VALIDATE_URL);
}
$redirectToIncoming = false;
$hasBeenDeleted = false;

Source: YesWiki commit e2603176a4607b83659635a0c517550d4a171cb9. The patch replaces the unsafe urldecode() call with filter_var() using the FILTER_VALIDATE_URL flag, ensuring only well-formed URLs pass through the handler.

Detection Methods for CVE-2025-46350

Indicators of Compromise

  • Web server access logs containing requests to deletepage.php with an incomingurl parameter carrying encoded <script>, javascript:, or onerror= payloads
  • Unexpected outbound HTTP requests from user browsers to attacker-controlled domains shortly after clicking wiki links
  • Session cookies for privileged YesWiki accounts appearing in referer headers or third-party domains
  • Unauthorized page modifications, defacements, or new administrative accounts created without a corresponding legitimate session

Detection Strategies

  • Deploy a web application firewall (WAF) rule that inspects the incomingurl parameter for HTML tags, script keywords, and non-URL characters
  • Enable and review YesWiki application logs for anomalous deletion attempts or requests containing encoded script fragments
  • Correlate suspicious inbound requests with subsequent session activity from the same account to detect hijacking

Monitoring Recommendations

  • Monitor for repeated requests to handlers/page/deletepage.php from a single source with varied incomingurl values
  • Alert on outbound connections from browser sessions to previously unseen domains immediately after wiki interactions
  • Track authenticated session reuse from geographically inconsistent IP addresses as a proxy for cookie theft

How to Mitigate CVE-2025-46350

Immediate Actions Required

  • Upgrade all YesWiki instances to version 4.5.4 or later, which contains the official fix
  • Invalidate active session cookies and force re-authentication for privileged accounts after patching
  • Review recent page deletion and modification activity for unauthorized changes
  • Educate wiki administrators and editors about the risks of clicking untrusted links while authenticated

Patch Information

The vulnerability is patched in YesWiki 4.5.4. The fix, tracked in commit e2603176a4607b83659635a0c517550d4a171cb9, replaces the unsafe urldecode() call with filter_var($_REQUEST['incomingurl'], FILTER_VALIDATE_URL) to reject any input that is not a syntactically valid URL. Full details are available in the GitHub Security Advisory GHSA-cg4f-cq8h-3ch8.

Workarounds

  • Restrict access to the handlers/page/deletepage.php endpoint using web server ACLs until patching is complete
  • Deploy a WAF rule that blocks requests containing script tags or javascript: schemes in the incomingurl parameter
  • Enforce a strict Content Security Policy (CSP) that disallows inline script execution to reduce reflected XSS impact
  • Configure session cookies with the HttpOnly and SameSite=Strict attributes to limit cookie theft via JavaScript
bash
# Example Apache WAF rule to block script payloads in incomingurl
SecRule ARGS:incomingurl "@rx (?i)(<script|javascript:|onerror=|onload=)" \
    "id:1004635,phase:2,deny,status:403,msg:'YesWiki CVE-2025-46350 XSS attempt blocked'"

# Enforce secure session cookies in php.ini
session.cookie_httponly = 1
session.cookie_samesite = "Strict"
session.cookie_secure = 1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.