Severity:

HIGH RISK

(7.3)

Unsafe Deserialization in tpadmin WebUploader preview.php

CVE-2026-2113

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-20, CWE-502, CWE-434

Impact:

Remote Code Execution / Data Compromise

Severity:

HIGH RISK

(7.3)

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

A vulnerable WebUploader handler in yuan1994 tpadmin up to version 1.3.12 performs unsafe PHP deserialization in preview.php, allowing attacker-controlled data to be turned into PHP objects.

When reachable over the network, this can enable remote attackers to execute arbitrary code or access sensitive data through crafted requests to the upload preview endpoint.

Affected context

The issue arises in tpadmin deployments that expose the WebUploader component, specifically the preview.php handler at:

/public/static/admin/lib/webuploader/0.1.5/server/preview.php

The vulnerability is present when this endpoint:

  • Accepts attacker-supplied input (e.g., from HTTP parameters or uploaded content)
  • Passes that input to PHP deserialization routines without strict validation
  • Runs under a PHP runtime with sufficient permissions to access application data or execute code

It primarily affects older tpadmin installations up to 1.3.12 that have not been retired or isolated.

Exploit preconditions

  • Attack surface: HTTP(S) interface exposing the WebUploader preview.php script.
  • Required access: Remote network access to the affected endpoint; no special privileges are typically required if the endpoint is publicly accessible.
  • Trigger point: Sending crafted data to parameters or upload content fields that are deserialized inside preview.php.
  • Why exploitation is possible: The code treats untrusted input as serialized PHP data and invokes deserialization logic without robust validation or filtering, allowing attacker-controlled object graphs to be instantiated.

Why this happens

The core issue is the use of unsafe deserialization within a web-exposed PHP script. In the vulnerable preview.php, incoming data associated with file preview or upload handling is assumed to be trustworthy and is passed directly to PHP deserialization mechanisms.

This behavior aligns with CWE-502: Deserialization of Untrusted Data, where external input is converted into complex objects that may invoke magic methods, autoloaders, or framework hooks during or after deserialization. Additionally, CWE-20: Improper Input Validation is implicated because the script does not sufficiently validate or constrain the structure and type of data before deserializing it. Abstractly, the pattern is:

  • Receive user-controlled input on a web endpoint
  • Deserialize it as native objects
  • Allow object behaviors and side effects to execute based on that untrusted state

Potential impact

  • Remote execution of arbitrary PHP code within the web server context
  • Unauthorized access to application configuration or sensitive data
  • Modification or deletion of application or user data handled by tpadmin
  • Use of the compromised server as a pivot for further attacks within the hosting environment
  • Deployment of webshells or persistent backdoors on the affected system

General mitigation guidance

Mitigation generally focuses on removing unsafe deserialization and shrinking the trust boundary around upload and preview functionality:

  • Replace generic deserialization of user-controlled data with explicit parsing of simple, well-defined data structures (e.g., JSON with strict schemas).
  • Avoid using unserialize or similar APIs on any request parameters or file content; instead, rely on whitelisted fields converted to primitive types.
  • Introduce strict input validation and type checking for all upload-related parameters and metadata before use.
  • Isolate upload and preview handlers behind authentication or access controls where feasible, and store uploaded files outside the webroot.
  • Run the PHP application with least-privilege filesystem and process permissions to limit damage if deserialization flaws occur.

How teams detect issues like this

Detection commonly combines code-centric review with operational monitoring:

  • Static analysis: Search for unserialize and related PHP APIs in web-exposed scripts, especially those handling uploads or previews, and flag cases where arguments originate from $_GET, $_POST, $_REQUEST, or uploaded file content.
  • Code review: Examine upload and preview handlers for patterns that deserialize inputs without schema validation; pay attention to magic methods (__wakeup, __destruct) in application classes that could be invoked during deserialization.
  • Policy enforcement: Establish internal coding standards that forbid deserialization of untrusted data and enforce them via pre-commit hooks or CI checks.
  • Runtime monitoring: Configure web and application logs to capture unusual requests to preview.php (e.g., abnormal parameter sizes or serialized payload signatures) and alert on repeated or anomalous access patterns.

Sources

SourceLink
github.comgithub.com/sTy1H/CVE-Report/blob/main/Remote%20Code%20Execution%20Vulnerability%20in%20Tpadmin%20System.md
vuldb.comvuldb.com/?ctiid.344688
vuldb.comvuldb.com/?id.344688
vuldb.comvuldb.com/?submit.746795

Frequently asked

questions

Yes. As described, the attack can be carried out remotely if an attacker can reach the WebUploader preview.php endpoint over the network and send crafted data.

Typically only network access to the affected tpadmin instance is required. If the endpoint is publicly exposed and does not enforce authentication or strong access control, any external user may attempt exploitation.

The safest pattern is to remove unsafe deserialization entirely from the upload/preview path, replacing it with explicit, typed parsing of simple formats and validating all incoming data against strict expectations before processing.

Avoid deserializing untrusted data in web-facing code, adopt secure coding guidelines that ban risky APIs for request handling, subject upload-related functionality to heightened review, and employ static analysis and CI policies to detect deserialization patterns early in development.

Find out what's already
exploitable in your codebase.