Skip to main content
Vulnerability Database/CVE-2026-113356

CVE-2026-113356: DokuWiki PHP Object Injection RCE Vulnerability

CVE-2026-113356 is a PHP object injection flaw in DokuWiki that enables authenticated users to execute arbitrary code through draft file manipulation. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-113356 Overview

CVE-2026-113356 is a PHP object injection vulnerability in DokuWiki releases prior to 2026-07-14c. The flaw resides in Draft::getDraftText(), which passes draft file contents to unserialize() without restricting allowed classes. Authenticated users holding edit rights can race concurrent draft rewrites to splice attacker-controlled serialized data into the draft file. Successful exploitation instantiates PHP gadget chains such as MemoryIndex or Installer, enabling arbitrary file write, file deletion, and remote code execution on the underlying host. The weakness is classified under CWE-502: Deserialization of Untrusted Data.

Critical Impact

Authenticated attackers with edit rights can achieve arbitrary code execution on the DokuWiki host by racing draft writes to inject a malicious serialized payload.

Affected Products

  • DokuWiki releases prior to 2026-07-14c
  • The inc/Draft.php component (Draft::getDraftText())
  • The inc/Cache/CacheInstructions.php cache retrieval path

Discovery Timeline

  • 2026-10-20 - CVE-2026-113356 published to NVD
  • 2026-10-20 - Last updated in NVD database

Technical Details for CVE-2026-113356

Vulnerability Analysis

DokuWiki persists in-progress page edits as PHP-serialized draft files on disk. When a user resumes editing, Draft::getDraftText() reads the draft file and calls unserialize() on its raw contents without specifying an allowed_classes option. Any class available in the DokuWiki runtime can therefore be instantiated through the deserialization process, triggering __wakeup(), __destruct(), and other magic methods on attacker-controlled object state.

Under normal conditions the draft file is written by the same authenticated session that reads it, limiting direct attacker control. The vulnerability becomes exploitable through a race condition where an attacker issues concurrent draft rewrite requests to splice an attacker-crafted serialized object into the file before getDraftText() deserializes it. Gadget chains such as MemoryIndex and Installer chain into arbitrary file write, file deletion, and code execution on the server.

Root Cause

The root cause is an unsafe call to unserialize() on file content whose integrity is not guaranteed. PHP's unserialize() is a well-documented sink for object injection ([CWE-502]) when allowed_classes is not set to false or a restricted list. The TOCTOU window between draft writes compounds the issue by letting authenticated users influence bytes that Draft::getDraftText() subsequently trusts.

Attack Vector

Exploitation requires an authenticated account with edit rights on a target page. The attacker races draft rewrite requests over the network to replace the draft file contents with a serialized gadget payload moments before Draft::getDraftText() consumes it. Successful exploitation yields arbitrary file write, file deletion, or code execution in the DokuWiki process context.

php
// Vendor fix in inc/Draft.php
            "Draft for page $this->id and user $this->client doesn't exist at $this->cname."
        );
    }
-   $draft = unserialize(io_readFile($this->cname, false));
+   $draft = unserialize(io_readFile($this->cname, false), ['allowed_classes' => false]);
    return cleanText(con($draft['prefix'], $draft['text'], $draft['suffix'], true));

Source: DokuWiki security commit 1531802

php
// Companion fix in inc/Cache/CacheInstructions.php
public function retrieveCache($clean = true)
{
    $contents = io_readFile($this->cache, false);
-   return empty($contents) ? [] : unserialize($contents);
+   return empty($contents) ? [] : unserialize($contents, ['allowed_classes' => ['stdClass']]);
}

Source: DokuWiki security commit 1531802

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-113356

Indicators of Compromise

  • Draft files under the DokuWiki data/cache/ or draft storage directories containing serialized object markers such as O: followed by DokuWiki class names like MemoryIndex or Installer.
  • Unexpected new or modified PHP files in web-accessible directories following authenticated edit sessions.
  • Bursts of concurrent POST requests to the editor endpoint for the same page from a single session, consistent with a race condition exploit.
  • Web server processes spawning shells or writing files outside the DokuWiki data directory.

Detection Strategies

  • Hunt for serialized PHP object signatures (O:\d+:") inside draft files; legitimate drafts should deserialize to a plain array with prefix, text, and suffix keys only.
  • Review web server access logs for high-frequency, overlapping requests to doku.php with do=draftdel, do=draft, or edit actions originating from the same user within milliseconds.
  • Add file integrity monitoring to the DokuWiki installation root and inc/ directory to detect unauthorized writes performed through gadget-driven file operations.

Monitoring Recommendations

  • Enable PHP error and audit logging for unserialize() warnings and track calls to Draft::getDraftText() on legacy builds.
  • Forward DokuWiki authentication, edit, and file-change events to a centralized SIEM for correlation with process execution telemetry on the host.
  • Alert on web server user accounts executing child processes such as /bin/sh, php -r, or curl immediately after an edit request.

How to Mitigate CVE-2026-113356

Immediate Actions Required

  • Upgrade DokuWiki to release 2026-07-14c or later, which restricts unserialize() to safe allowed classes.
  • Audit existing accounts and revoke edit rights from any user that does not require them, reducing the authenticated attack surface.
  • Inspect the draft storage directory for suspicious serialized payloads and remove any drafts that do not match the expected prefix/text/suffix structure.
  • Review web root and inc/ directory contents for unauthorized files written during the exposure window.

Patch Information

The vendor fix is tracked in DokuWiki commit 1531802afb2ac3eea147a887600fa5750e74e681 and shipped in the DokuWiki release-2026-07-14c tag. The patch adds ['allowed_classes' => false] to the unserialize() call in inc/Draft.php and restricts the cache deserializer in inc/Cache/CacheInstructions.php to stdClass. Additional context is available in the VulnCheck advisory and the DokuWiki issue tracker entry.

Workarounds

  • If immediate patching is not possible, restrict wiki edit permissions to a minimal set of trusted users via DokuWiki ACLs.
  • Deploy a web application firewall rule that rate-limits concurrent edit and draft requests per authenticated session to disrupt the race window.
  • Make the DokuWiki installation directory read-only for the web server user where feasible, so gadget-driven writes to PHP files are blocked by the filesystem.
  • Monitor and purge the draft storage directory on a short interval to shrink the window in which a malicious serialized payload can persist.
bash
# Verify installed DokuWiki version and apply the vendor patch
grep -i '^date' /path/to/dokuwiki/VERSION
cd /path/to/dokuwiki
git fetch --tags
git checkout release-2026-07-14c
# Restrict draft directory to the web server user only
chown -R www-data:www-data data/cache data/meta
chmod -R 750 data/cache data/meta

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.