# YesWiki: Second-Order SQL Injection in Page Delete API via Unescaped Page Tag (`ApiController::deletePage`)

High severity, published 2026-07-09. Update yeswiki/yeswiki to 4.6.6 or later: composer update yeswiki/yeswiki.

Canonical URL: https://buzzphp.com/security/ghsa-8f2v-2qhj-gfwg · Data from GitHub as of 2026-11-25.

| | |
| --- | --- |
| Severity | high (CVSS 8.3) |
| Published | 2026-07-09 |
| Updated | 2026-07-09 |
| CVE | [CVE-2026-52771](https://nvd.nist.gov/vuln/detail/CVE-2026-52771) |
| GHSA | [GHSA-8f2v-2qhj-gfwg](https://github.com/advisories/GHSA-8f2v-2qhj-gfwg) |
| Weakness | CWE-89 |

| Package | Affected versions | Fixed in |
| --- | --- | --- |
| yeswiki/yeswiki | >= 4.2.0, < 4.6.6 | 4.6.6 |

## What to do

Update yeswiki/yeswiki to 4.6.6 or later: composer update yeswiki/yeswiki.

Check which version you run with `composer show yeswiki/yeswiki`, and every affected package with `composer audit`.

## About this advisory

Summary ApiController::deletePage() interpolates a page tag retrieved from the database into a DELETE FROM …links WHERE totag = '$tag' query without escaping. The page tag is attacker-controlled — the POST /api/pages/{tag} API accepts arbitrary URL-encoded values, including single quotes, and stores them. A low-privilege authenticated user can therefore create a page whose tag is a SQL fragment, make the page non-orphaned via the standard {{include page="…"}} link mechanism, and then invoke the delete endpoint to execute arbitrary SQL inside the wiki database - including time-based blind data exfiltration from any table.



## Links

- [GHSA-8f2v-2qhj-gfwg on GitHub](https://github.com/advisories/GHSA-8f2v-2qhj-gfwg)
- [CVE-2026-52771 on the National Vulnerability Database](https://nvd.nist.gov/vuln/detail/CVE-2026-52771)
- [All Composer security advisories](https://buzzphp.com/security)
