/

CVE-2026-93872

Severity:

HIGH RISK

(7.5)

Unsafe Deserialization (CWE-502) in Cotonti Comments

CVE-2026-93872

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Potential File Write and Remote 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

Cotonti's comments plugin unserializes a base64-decoded parameter without restricting which PHP classes may be created. A registered user with comment write permissions may exploit this behavior to instantiate attacker-controlled objects, potentially enabling file writes or code execution through available gadget chains.

Affected context

The vulnerability occurs in Cotonti 1.0.0's comments plugin EditAction when the cb parameter is accepted from a user who can write comments. Risk exists when the parameter is decoded and passed to PHP unserialize() without an allowed-class policy, and when exploitable gadget chains are available in the application's loaded code or dependencies.

Exploit preconditions

  • Attack surface: The comments plugin's EditAction request handling
  • Required access: A registered account with permission to write comments
  • Trigger point: Processing of the base64-decoded cb parameter
  • Why exploitation is possible: PHP object deserialization occurs without restricting permitted classes, allowing attacker-controlled object graphs to be instantiated

Why this happens

The underlying bug is unsafe deserialization of user-controlled data. Passing decoded input to PHP unserialize() without an allowed_classes restriction permits construction of arbitrary classes known to the runtime, mapping to CWE-502: Deserialization of Untrusted Data. If suitable magic methods or other gadget-chain components are present, object instantiation may produce security-relevant side effects.

Potential impact

  • File creation, modification, or deletion may be possible
  • Server-side code execution could occur through an applicable gadget chain
  • Application data or configuration may be altered
  • The affected account's privileges could be used to expand application compromise
  • Confidential information may be exposed

General mitigation guidance

Mitigation generally focuses on eliminating object deserialization of untrusted input and reducing the trust placed in request parameters.

Common defensive patterns include:

  • Replace native object deserialization with a safe, explicit data format such as structured JSON
  • If legacy deserialization is unavoidable, enforce a narrowly defined allowed-class policy and reject unexpected object types
  • Validate decoded input against a strict schema before processing it
  • Keep comment-edit permissions limited to users and roles that require them
  • Separate application write permissions from executable code and sensitive configuration paths
  • Reduce available gadget chains by minimizing unnecessary dependencies and disabling unsafe application behaviors

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving unserialize() on request, cookie, or other externally controlled data
  • Code-review signals where base64 decoding is followed by deserialization without class restrictions
  • Policies that prohibit native PHP object deserialization for web-facing inputs
  • Runtime monitoring for anomalous comment-edit requests, unusual parameter sizes, or unexpected file changes
  • Dependency and application inventory reviews to identify potential magic-method gadget chains

Automated security review tools may help identify unsafe deserialization flows when data-flow analysis is available.

Sources

SourceLink
github.comgithub.com/Cotonti/Cotonti
github.comgithub.com/Cotonti/Cotonti/blob/1.0.0/plugins/comments/controllers/actions/EditAction.php
github.comgithub.com/Cotonti/Cotonti/blob/1.0.0/system/cache.php
github.comgithub.com/Cotonti/Cotonti/issues/1894
github.comgithub.com/Cotonti/Cotonti/pull/1897
vulncheck.comvulncheck.com/advisories/cotonti-1.0.0-php-object-injection-via-comments-plugin-edit-action-cb-parameter

Frequently asked

questions

The described attack path requires a registered user account with permission to write comments. The practical scope also depends on the application's enabled plugins, dependencies, and available gadget chains.

No. Object instantiation alone does not guarantee code execution. The outcome depends on whether usable gadget chains are present, though file manipulation or other side effects may still be possible.

Avoid deserializing user-controlled data with PHP unserialize(). Prefer a simple data format with strict schema validation, or enforce a narrowly scoped allowed-class policy when compatibility requires object deserialization.

Treat decoded request values as untrusted, apply security review rules to all deserialization paths, minimize write privileges, and monitor application behavior for unexpected object or file-system activity.

Find out what's already
exploitable in your codebase.