CVE-2025-24019: YesWiki vulnerable to authenticated arbitrary file deletion

Published Jan 21, 2025
·
Updated

Authenticated arbitrary file deletion in YesWiki <= 4.4.5

Summary It is possible for any authenticated user, through the use of the filemanager to delete any file owned by the user running the FastCGI Process Manager (FPM) on the host without any limitation on the filesystem's scope.

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 filemanager that allows a user to manage files that are attached to a resource when they have owner permission on it. This part of the code is managed in tools/attach/libs/attach.lib.php

php public function doFileManager($isAction = false) { $do = (isset($GET['do']) && $GET['do']) ? $GET['do'] : ''; switch ($do) { case 'restore': $this->fmRestore(); $this->fmShow(true, $isAction); break; case 'erase': $this->fmErase(); $this->fmShow(true, $isAction); break; case 'del': $this->fmDelete(); $this->fmShow(false, $isAction); break; case 'trash': $this->fmShow(true, $isAction); break; case 'emptytrash': $this->fmEmptyTrash(); //pas de break car apres un emptytrash => retour au gestionnaire // no break default: $this->fmShow(false, $isAction); } }

The fmErase() function doesn't sanitize or verify the path that has been provided by the user in any way. Thus allowing a malicious user to specify any arbitrary file on the filesystem and having it deleted through the use of unlink() (as long as the user that runs the process has permission to delete it).

php public function fmErase() { $path = $this->GetUploadPath(); $filename = $path . '/' . ($GET['file'] ? $GET['file'] : ''); if (fileexists($filename)) { unlink($filename); } }

In addition to this deletion accross all the filesystem through fmErase(), it is also possible to delete any file attached to an existing wiki page, for instance, if user A creates a page and attaches images/documents to it, they always get uploaded to the files/ directory. If user B (malicious), knows the path of the files he can also arbitrarly delete them. (fmDelete() is also impacted by this case)

PoC 1. Environnement setup The following actions have been performed as a privileged user

First, let's create one user (in addition to the WikiAdmin user):

!poc1

Restrict the edition of 'PagePrincipale' wiki page to administrators only:

!poc2

2. Upload of a file on a resource not owned by our user The following actions have been performed as a privileged user

Second, let's upload a media to this PagePrincipale wiki page:

!poc3 !poc4

Then view it in the page's filemanager:

!poc5

We can confirm that our file has been uploaded to the files/ directory by directly looking at the yeswiki container:

!poc5 1

3. Arbitrary deletion (in files/) The following actions have been performed using an unprivileged user

Now, get the full path/name of the media in the files directory by opening it in a new tab:

!poc6

Afterwards, we need an instance of filemanager to be accessible to our user so we need to create a page that we own, here is used the agenda and the creation of a new event:

!poc7

Call the erase method on the PagePrincipale's uploaded media:

!poc

The media is now deleted from PagePrincipale (the button is shown when the attached media doesn't exist, it's an intended behaviour):

!poc9

It has also disappeared from the files/ directory:

!poc10

This behaviour can be applied to any file under the files/ directory.

4. Arbitrary deletion (in /tmp/) The following actions have been performed using a privileged access

Finally, using the same user as the process running the app, we create a file under the /tmp directory:

!poc11

The following actions have been performed using an unprivileged user

We can once again call the erase method using a relative path:

!poc3

The file isn't here anymore:

!poc13

Impact This vulnerability allows any authenticated user to arbitrarly remove content from the Wiki resulting in partial loss of data and defacement/deteroriation of the website. In the context of a container installation of YesWiki without any modification, the 'yeswiki' files (for example .php) are not owned by the same user (root) as the one running the FPM process (www-data). However in a standard installation, www-data may also be the owner of the PHP files, allowing a malicious user to completely cut the access to the wiki by deleting all important PHP files (like index.php or core files of YesWiki).

Suggestion of possible corrective measures

- Restrict the possible paths of fmErase() to the uploadpath directory.

- Restrict the use of fmErase() to trashed files only.

php public function fmErase() { $path = $this->GetUploadPath(); $filename = $this->GetUploadPath() . '/' . basename(realpath(($GET['file'] ? $GET['file'] : ''))); //Sanitize file path if (fileexists($filename) && pregmatch('/trash\d{14}$/', $filename)) { //Make sure that the filename ends with trash and a date unlink($filename); } }

- Make sure that any request to fmErase() or fmDelete() originates from the owner of the resource to which the attachment is linked (asks a bit more than a few lines of code).

Other sources

YesWiki is a wiki system written in PHP. In versions up to and including 4.4.5, it is possible for any authenticated user, through the use of the filemanager to delete any file owned by the user running the FastCGI Process Manager (FPM) on the host without any limitation on the filesystem's scope. This vulnerability allows any authenticated user to arbitrarily remove content from the Wiki resulting in partial loss of data and defacement/deterioration of the website. In the context of a container installation of YesWiki without any modification, the yeswiki files (for example .php) are not owned by the same user (root) as the one running the FPM process (www-data). However in a standard installation, www-data may also be the owner of the PHP files, allowing a malicious user to completely cut the access to the wiki by deleting all important PHP files (like index.php or core files of YesWiki). Version 4.5.0 contains a patch for this issue.

NVD

Affected Software

4 affected componentsFixes available
composer/yeswiki/yeswiki<=4.4.5
4.5.0
YesWiki YesWiki<=4.4.5
YesWiki YesWiki>4.5.0
YesWiki YesWiki<4.5.0

Event History

Jan 21, 2025
CVE Published
via MITRE·05:36 PM
Data Sourced
via MITRE·05:36 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·08:11 PM
Data Sourced
via GitHub·08:11 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2025-24019?

CVE-2025-24019 is classified as a critical vulnerability due to its potential for arbitrary file deletion by authenticated users.

2

How do I fix CVE-2025-24019?

To fix CVE-2025-24019, users must upgrade to YesWiki version 4.5.0 or later.

3

Who is affected by CVE-2025-24019?

CVE-2025-24019 affects all authenticated users of YesWiki versions up to and including 4.4.5.

4

What are the implications of CVE-2025-24019?

The implications of CVE-2025-24019 include unauthorized file deletion, leading to potential data loss or service disruption.

5

Can CVE-2025-24019 be exploited remotely?

CVE-2025-24019 requires user authentication, so it cannot be exploited remotely by unauthenticated attackers.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203