/

CVE-2026-14637

Severity:

HIGH RISK

(8.2)

Unsafe PHP Deserialization (CWE-502) in ShoppingCart

CVE-2026-14637

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-20, CWE-502

Impact:

Remote Code Execution and Application Takeover

Severity:

HIGH RISK

(8.2)

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

An unsafe PHP deserialization flaw in the ShoppingCart library of kirilkirkov Ecommerce-CodeIgniter-Bootstrap allows attacker-controlled data in the shopping_cart argument to be deserialized.

When remote input is passed directly into getCartItems without validation, an attacker may trigger arbitrary object instantiation, leading to code execution or application compromise.

Affected context

The vulnerability occurs within the getCartItems function in application/libraries/ShoppingCart.php, where the shopping_cart parameter is treated as serialized data and deserialized.

It is relevant in deployments where user-supplied cart state is stored and returned (e.g., via cookies, session data, or request parameters) and then passed into the shopping cart library without strong validation or integrity protection.

Installations using continuous delivery with rolling releases may have varying code states, so the exact affected version depends on whether the unsafe deserialization pattern is present in their deployed build.

Exploit preconditions

  • Attack surface: Web application endpoints that accept or reconstruct shopping_cart data and call getCartItems.
  • Required access: Ability to send crafted HTTP requests or otherwise influence the shopping_cart argument (e.g., tampering with cookies, POST/GET parameters, or session-backed values).
  • Trigger point: Execution of getCartItems when it deserializes attacker-controlled data.
  • Why exploitation is possible: The function trusts the serialized structure of shopping_cart and uses deserialization without validating type, structure, or origin, enabling arbitrary object creation and associated magic method execution.

Why this happens

This issue stems from treating untrusted input as safely serializable state and passing it into generic deserialization APIs in PHP.

When attacker-controlled data is deserialized, PHP may instantiate arbitrary classes and invoke magic methods (such as __wakeup or destructors) that can perform sensitive actions.

Conceptually, this maps to CWE-502: Unsafe Deserialization, combined with CWE-20: Improper Input Validation, because the code does not enforce strict validation, integrity checks, or type constraints before deserializing the shopping_cart value.

Potential impact

  • Remote execution of application-level logic via malicious object graphs.
  • Unauthorized modification of cart contents and pricing data.
  • Escalation to full application compromise through gadget chains in existing classes.
  • Data exfiltration from the application context or associated storage.
  • Abuse of business logic related to orders, discounts, or inventory.

General mitigation guidance

Mitigation typically focuses on eliminating unsafe deserialization of untrusted data and reducing the trust placed in client-controlled state.

Common defensive patterns include:

  • Avoiding generic deserialization of data that originates from clients; instead, use structured formats such as JSON with explicit schema validation.
  • Restricting the types and classes that can be instantiated from serialized data, or replacing object-based serialization with simple scalar/array representations.
  • Validating cart data against expected schemas, ranges, and allowed values before processing.
  • Ensuring cart state is stored server-side with integrity protection, rather than trusting client-provided serialized blobs.
  • Applying least-privilege principles to application components so that any compromise has limited blast radius.

How teams detect issues like this

Detection efforts can focus on identifying unsafe deserialization patterns and misuse of serialized state:

  • Static analysis rules that flag calls to unserialize() or equivalent APIs where input originates from HTTP requests, cookies, or other untrusted sources.
  • Code review practices that question any use of serialized objects in session or cart handling and require justification and validation logic.
  • Central security policies that forbid object deserialization of client-controlled data and mandate safer structured formats.
  • Automated scanning tools that look for known PHP gadget chains combined with untrusted deserialization sinks.

Sources

SourceLink
github.comgithub.com/kirilkirkov/Ecommerce-CodeIgniter-Bootstrap/
github.comgithub.com/kirilkirkov/Ecommerce-CodeIgniter-Bootstrap/commit/49b20f53de2b7ec34e920b11c863f1491d911a04
github.comgithub.com/kirilkirkov/Ecommerce-CodeIgniter-Bootstrap/security/advisories/GHSA-9g5q-g6m3-v5cr
vuldb.comvuldb.com/cve/CVE-2026-14637
vuldb.comvuldb.com/submit/845908
vuldb.comvuldb.com/vuln/376152
vuldb.comvuldb.com/vuln/376152/cti

Frequently asked

questions

Yes. If an attacker can control the shopping_cart data passed to getCartItems via web requests or client-side storage, exploitation can be performed remotely through the application's public interface.

The attacker generally needs only the ability to send crafted HTTP requests or manipulate client-controlled cart state (such as cookies or request parameters); no authenticated administrative access is inherently required, though the exact risk depends on how the application exposes cart functionality.

The most robust fix is to stop deserializing untrusted objects entirely. Replace object-based serialization with simple, validated data structures (e.g., JSON arrays), enforce strict schemas on cart data, and ensure only server-controlled, integrity-protected state is processed.

Establish development guidelines that prohibit unsafe deserialization, perform regular static analysis for deserialization sinks, and require security review of any code that handles client-side state. Using well-defined data formats, strong validation, and centralized state management significantly reduces the chance of similar flaws.

Find out what's already
exploitable in your codebase.