/

CVE-2026-113356

Severity:

HIGH RISK

(7.5)

PHP Object Injection (CWE-502) in DokuWiki Draft Handling

CVE-2026-113356

Awaiting Analysis

Vulnerability type

Category:

PHP Object Injection

CWE:

CWE-502

Impact:

Arbitrary File Operations and Potential Code Execution

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

DokuWiki contains a PHP object injection vulnerability in draft handling because draft contents are passed to unserialize() without restricting permitted classes. An authenticated user with edit rights may race concurrent draft rewrites to inject serialized objects, potentially enabling arbitrary file operations or code execution through available gadget chains.

DokuWiki contains a PHP object injection vulnerability in draft handling because draft contents are passed to unserialize() without restricting permitted classes. An authenticated user with edit rights may race concurrent draft rewrites to inject serialized objects, potentially enabling arbitrary file operations or code execution through available gadget chains.

Affected context

The issue may affect DokuWiki deployments where:

  • Authenticated users have permission to edit pages and create or update drafts
  • Draft data is processed by Draft::getDraftText()
  • Draft files can be modified through concurrent rewrite behavior
  • PHP object deserialization can instantiate application or framework classes without an allowed-class restriction

Exploitability depends on the configured permissions, timing behavior, and availability of usable gadget classes.

The issue may affect DokuWiki deployments where:

  • Authenticated users have permission to edit pages and create or update drafts
  • Draft data is processed by Draft::getDraftText()
  • Draft files can be modified through concurrent rewrite behavior
  • PHP object deserialization can instantiate application or framework classes without an allowed-class restriction

Exploitability depends on the configured permissions, timing behavior, and availability of usable gadget classes.

Exploit preconditions

  • Attack surface: DokuWiki draft management and editing functionality
  • Required access: An authenticated account with edit rights
  • Trigger point: Processing draft contents through Draft::getDraftText()
  • Timing condition: The attacker must be able to coordinate concurrent draft rewrites to influence serialized data
  • Why exploitation is possible: Unrestricted deserialization may instantiate attacker-influenced PHP objects, including classes that expose file or command execution behavior
  • Attack surface: DokuWiki draft management and editing functionality
  • Required access: An authenticated account with edit rights
  • Trigger point: Processing draft contents through Draft::getDraftText()
  • Timing condition: The attacker must be able to coordinate concurrent draft rewrites to influence serialized data
  • Why exploitation is possible: Unrestricted deserialization may instantiate attacker-influenced PHP objects, including classes that expose file or command execution behavior

Why this happens

The vulnerability results from passing attacker-influenced draft data to PHP unserialize() without constraining which classes may be created. PHP deserialization can invoke object construction and lifecycle behavior for serialized classes, allowing existing application classes to act as gadget chains when their methods perform sensitive operations. This behavior maps to CWE-502: Deserialization of Untrusted Data.

The vulnerability results from passing attacker-influenced draft data to PHP unserialize() without constraining which classes may be created. PHP deserialization can invoke object construction and lifecycle behavior for serialized classes, allowing existing application classes to act as gadget chains when their methods perform sensitive operations. This behavior maps to CWE-502: Deserialization of Untrusted Data.

Potential impact

  • An attacker may write or delete files accessible to the DokuWiki process
  • An attacker could alter application content or configuration
  • Available gadget chains may enable arbitrary PHP or operating system command execution
  • The DokuWiki instance may be compromised
  • Compromise could support persistence, data manipulation, or lateral movement
  • An attacker may write or delete files accessible to the DokuWiki process
  • An attacker could alter application content or configuration
  • Available gadget chains may enable arbitrary PHP or operating system command execution
  • The DokuWiki instance may be compromised
  • Compromise could support persistence, data manipulation, or lateral movement

General mitigation guidance

Mitigation generally focuses on removing unsafe object deserialization and reducing trust in draft data.

Common defensive patterns include:

  • Prefer structured data formats that do not instantiate executable objects
  • Replace unrestricted unserialize() calls with constrained parsing and explicit data reconstruction
  • Apply strict allowed-class policies when object deserialization cannot be avoided
  • Validate draft content and enforce integrity protections before processing it
  • Serialize only narrowly defined data-transfer structures rather than general application objects
  • Run the application with least-privilege filesystem and operating-system permissions
  • Restrict authenticated editing capabilities to trusted users and protect draft storage from unauthorized modification

Mitigation generally focuses on removing unsafe object deserialization and reducing trust in draft data.

Common defensive patterns include:

  • Prefer structured data formats that do not instantiate executable objects
  • Replace unrestricted unserialize() calls with constrained parsing and explicit data reconstruction
  • Apply strict allowed-class policies when object deserialization cannot be avoided
  • Validate draft content and enforce integrity protections before processing it
  • Serialize only narrowly defined data-transfer structures rather than general application objects
  • Run the application with least-privilege filesystem and operating-system permissions
  • Restrict authenticated editing capabilities to trusted users and protect draft storage from unauthorized modification

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying unserialize() calls on request, file, draft, cache, or other user-influenced data
  • Code review checks for missing allowed-class restrictions and unsafe magic-method behavior
  • Searches for gadget classes that write, delete, include, or execute files during deserialization
  • Monitoring for unusual concurrent draft updates, unexpected draft-file changes, and web-process file modifications
  • Policy enforcement that blocks unrestricted PHP deserialization in application code

Automated security review tools may help identify dangerous data flows, but findings should be validated against actual permissions and runtime behavior.

Organizations can look for this class of issue through:

  • Static analysis rules identifying unserialize() calls on request, file, draft, cache, or other user-influenced data
  • Code review checks for missing allowed-class restrictions and unsafe magic-method behavior
  • Searches for gadget classes that write, delete, include, or execute files during deserialization
  • Monitoring for unusual concurrent draft updates, unexpected draft-file changes, and web-process file modifications
  • Policy enforcement that blocks unrestricted PHP deserialization in application code

Automated security review tools may help identify dangerous data flows, but findings should be validated against actual permissions and runtime behavior.

Sources

SourceLink
gist.github.comgist.github.com/sebastianosrt/a0c0252ca335e8e8b2c96fecf1f64538
github.comgithub.com/dokuwiki/dokuwiki/blob/b61db59a8091fc992ac02959a9a09b576cc43ce0/inc/Draft.php#L122
github.comgithub.com/dokuwiki/dokuwiki/commit/1531802afb2ac3eea147a887600fa5750e74e681
github.comgithub.com/dokuwiki/dokuwiki/issues/4752
github.comgithub.com/dokuwiki/dokuwiki/releases/tag/release-2026-07-14c
vulncheck.comvulncheck.com/advisories/dokuwiki-before-2026-07-14c-php-object-injection-via-draft-race-condition

Frequently asked

questions

It may be exploitable over the application interface by an authenticated user who can edit content, provided the required draft race and gadget conditions can be met.

Not necessarily. Edit rights are the stated access requirement, although practical impact depends on the user's permissions and the privileges of the DokuWiki process.

Avoid deserializing untrusted draft data into PHP objects. Use structured data parsing, explicit field mapping, and strict class restrictions where legacy compatibility requires deserialization.

Treat drafts, caches, and uploaded files as untrusted input, review all deserialization flows, limit gadget-capable classes, and run the application with minimal filesystem and operating-system privileges.

It may be exploitable over the application interface by an authenticated user who can edit content, provided the required draft race and gadget conditions can be met.

Not necessarily. Edit rights are the stated access requirement, although practical impact depends on the user's permissions and the privileges of the DokuWiki process.

Avoid deserializing untrusted draft data into PHP objects. Use structured data parsing, explicit field mapping, and strict class restrictions where legacy compatibility requires deserialization.

Treat drafts, caches, and uploaded files as untrusted input, review all deserialization flows, limit gadget-capable classes, and run the application with minimal filesystem and operating-system privileges.

Find out what's already
exploitable in your codebase.