GHSA-8f2v-2qhj-gfwg: YesWiki: Second-Order SQL Injection in Page Delete API via Unescaped Page Tag (`ApiController::deletePage`)
YesWiki versions 4.2.0 through 4.6.5 contain a second-order SQL injection vulnerability in the ApiController::deletePage() method. An authenticated low-privilege user can create a page with a malicious tag containing SQL code, which is stored safely but later used unescaped in a DELETE SQL query. This allows execution of arbitrary SQL commands in the wiki database, including time-based blind data exfiltration. The vulnerability arises because the page tag is read back from the database and interpolated into a SQL query without proper escaping. Exploitation requires three steps: planting the malicious tag, making the page non-orphaned via an include directive, and invoking the delete API endpoint. No official patch information is provided.
AI Analysis
Technical Summary
The vulnerability is a classic second-order SQL injection in YesWiki's ApiController::deletePage() method. The API accepts arbitrary page tags via POST /api/pages/{tag}, storing them with proper escaping. However, when deleting a page, the stored tag is retrieved and directly interpolated into a DELETE SQL query without escaping, allowing injection. The deletePage method checks ownership and orphan status before executing the unescaped DELETE query on the links table. This flaw enables an authenticated low-privilege user to execute arbitrary SQL commands, including time-based blind data extraction, by crafting a malicious page tag and triggering the delete endpoint. Similar unescaped usage of the tag occurs in adjacent files but the API route is the easiest exploitation vector.
Potential Impact
An authenticated low-privilege user can exploit this vulnerability to execute arbitrary SQL commands on the YesWiki database. This includes the ability to perform time-based blind SQL injection attacks to exfiltrate sensitive data from any accessible table. The vulnerability compromises confidentiality and integrity of the database and may cause partial denial of service due to injected queries. The impact is high given the ability to execute arbitrary SQL and extract data.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict access to the API delete endpoint to trusted users only, or disable the API if possible. Avoid creating pages with untrusted tags and monitor for suspicious activity. Review and update the code to properly escape or parameterize SQL queries that use user-controlled data retrieved from the database. Do not rely solely on escaping at insert time; ensure all SQL query inputs are safely handled at every usage point.
GHSA-8f2v-2qhj-gfwg: YesWiki: Second-Order SQL Injection in Page Delete API via Unescaped Page Tag (`ApiController::deletePage`)
Description
YesWiki versions 4.2.0 through 4.6.5 contain a second-order SQL injection vulnerability in the ApiController::deletePage() method. An authenticated low-privilege user can create a page with a malicious tag containing SQL code, which is stored safely but later used unescaped in a DELETE SQL query. This allows execution of arbitrary SQL commands in the wiki database, including time-based blind data exfiltration. The vulnerability arises because the page tag is read back from the database and interpolated into a SQL query without proper escaping. Exploitation requires three steps: planting the malicious tag, making the page non-orphaned via an include directive, and invoking the delete API endpoint. No official patch information is provided.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability is a classic second-order SQL injection in YesWiki's ApiController::deletePage() method. The API accepts arbitrary page tags via POST /api/pages/{tag}, storing them with proper escaping. However, when deleting a page, the stored tag is retrieved and directly interpolated into a DELETE SQL query without escaping, allowing injection. The deletePage method checks ownership and orphan status before executing the unescaped DELETE query on the links table. This flaw enables an authenticated low-privilege user to execute arbitrary SQL commands, including time-based blind data extraction, by crafting a malicious page tag and triggering the delete endpoint. Similar unescaped usage of the tag occurs in adjacent files but the API route is the easiest exploitation vector.
Potential Impact
An authenticated low-privilege user can exploit this vulnerability to execute arbitrary SQL commands on the YesWiki database. This includes the ability to perform time-based blind SQL injection attacks to exfiltrate sensitive data from any accessible table. The vulnerability compromises confidentiality and integrity of the database and may cause partial denial of service due to injected queries. The impact is high given the ability to execute arbitrary SQL and extract data.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict access to the API delete endpoint to trusted users only, or disable the API if possible. Avoid creating pages with untrusted tags and monitor for suspicious activity. Review and update the code to properly escape or parameterize SQL queries that use user-controlled data retrieved from the database. Do not rely solely on escaping at insert time; ensure all SQL query inputs are safely handled at every usage point.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-8f2v-2qhj-gfwg
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-52771"]
- Ecosystems
- ["Packagist"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a50ba7368715ace43580280
Added to database: 07/10/2026, 09:25:07 UTC
Last enriched: 07/10/2026, 09:55:30 UTC
Last updated: 07/10/2026, 09:55:30 UTC
Views: 2
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.