CloFix WAF · Core Security Features

WordPress Hardening & Protection

Comprehensive security for WordPress sites - blocks XML-RPC attacks, login brute force, user enumeration, REST API abuse, vulnerability scanners, and zero-day exploit patterns. Core WAF controls covering OWASP-class attacks, abuse, and protocol threats.

Core Security Features #93 38 details Published

Overview

💡 How it works: The WordPress protection engine intercepts requests before they reach your WordPress installation. It applies 35+ security checks in sequence - from early detection (scanner UAs, SQLi patterns, null bytes) to application-specific rules (XML-RPC blocking, login brute force, REST API rate limiting). Each violation adds threat points; reaching configurable threshold triggers temporary IP ban (default 30 minutes). Threat scores decay naturally after 30 minutes of clean behavior. The response path strips version fingerprints, emoji scripts, and feed links from HTML output. All regex patterns are pre-compiled at startup - performance impact under 1ms per request even on high-traffic WordPress sites.

📊 Protection Metrics:

🔒 Attack Vectors Covered:

Feature details

XML-RPC Attack Prevention

Blocks xmlrpc.php completely with multicall brute force detection - identifies large POST bodies (8KB+) used for credential stuffing. Add 60 threat points instantly

Login Brute Force Protection

5-attempt window triggers temporary ban (default 30 minutes). Configurable attempt limits and ban duration. Threat score adds 60 points on ban

User Enumeration Blocking

Blocks ?author=N scans and /author/ archive enumeration - prevents attackers from discovering usernames for brute force attacks. Adds 20 threat points

REST API Security

Blocks /wp-json/wp/v2/users enumeration, rate-limits REST API (60 req/min), protects unauthenticated write endpoints (POST/PUT/DELETE). Adds 30 threat points for enumeration attempts

Sensitive File Protection

Blocks access to .env, .git/config, .htaccess, .htpasswd, wp-config.php, backup files (.zip, .tar.gz, .sql), and 25+ other sensitive patterns

Exploit Path Blocking

Pre-configured detection for 25+ known vulnerability paths including RevSlider RCE, TimThumb, File Manager, Duplicator installer, Adminer, and Elementor exploits. Adds 50 threat points

PHP Execution in Uploads

Blocks any .php, .php5, .phtml, .phar execution from /wp-content/uploads/ directory - prevents uploaded shell access. Adds 70 threat points

SQL Injection Protection

Regex patterns detecting UNION SELECT, INSERT INTO, DROP TABLE, OR 1=1, time-based attacks (SLEEP/BENCHMARK), information_schema access. Adds 50 threat points

XSS Attack Prevention

Detects script tags, JavaScript protocol, event handlers (onload/onerror), iframe/frame injection, expression() CSS exploits, encoded entities. Adds 40 threat points

Path Traversal Detection

Blocks ../, ..\, URL-encoded (%2e%2e%2f) and double-encoded (%252e%252e%252f) traversal attempts - prevents sensitive file reads. Adds 40 threat points

Null Byte Injection Prevention

Detects \x00, %00, \0 sequences in URI and query strings - prevents file inclusion bypass techniques. Adds 30 threat points

Scanner User-Agent Blocking

Identifies 20+ security scanners (WPScan, Nuclei, Nikto, Dirbuster, Masscan) and blocks instantly. Adds 50 threat points

Bad Bot Prevention

Blocks 15+ malicious bots (MJ12bot, Semrush, Ahrefs, Dotbot, Petalbot, BleXbot, Yisou, Sogou, Baiduspider, 360spider)

Threat Score Accumulation

Each blocked attempt adds configurable points. Reaching threshold (default 100) triggers 30-minute IP ban. Prevents distributed attacks

wp-cron.php External Blocking

Only allows execution from localhost - prevents external trigger abuse and DoS via cron endpoint

Debug Log Protection

Blocks /wp-content/debug.log access - prevents information leakage of PHP errors, database queries, and backtraces

Installer File Protection

Blocks /wp-admin/install.php, upgrade.php, setup-config.php after initial setup - prevents site takeover via reinstallation

TimThumb Vulnerability Block

Detects timthumb.php patterns in URI or query strings - prevents famous 0-day RCE exploit. Adds 50 threat points

Directory Browsing Prevention

Blocks directory listings in /wp-content/ and /wp-includes/ - prevents asset enumeration and version fingerprinting

Hotlink Protection

Prevents external sites from hotlinking your images, CSS, or static assets - saves bandwidth and prevents DDOS via image requests

Admin CSRF Protection

Validates Referer header on wp-admin POST requests - prevents cross-site request forgery attacks. Adds 30 threat points on failure

Strict HTTP Methods

Only allows GET, POST, HEAD methods on wp-admin - blocks DELETE, PUT, PATCH, OPTIONS, TRACE methods. Returns 405 Method Not Allowed

Admin IP Allowlisting

Restrict /wp-admin and /wp-login.php to specific IP ranges - perfect for corporate environments or jump hosts

Rate Limiting (Per-IP)

Configurable request limits (default 300 requests/60 seconds) - prevents scraping, DoS, and crawling attacks

REST API Rate Limiting

Separate rate limits for REST endpoints (default 60 req/min) - prevents API abuse while allowing normal plugin operations

Version Fingerprint Removal

Strips tag, removes ?ver=x.x.x from assets (CSS/JS/images), sanitizes Link header with wp-json - hides WordPress version

Emoji Script Removal

Removes wp-emoji-release.min.js - hides version leak and reduces DOM size. Saves ~15KB per page load

Feed Discovery Removal

Strips RSS/Atom feed links from HTML headers - prevents content scraping and reduces attack surface

Theme & Plugin Info Blocking

Blocks access to /wp-content/themes/*/readme.txt, style.css, license.txt - prevents version fingerprinting and vulnerability matching

Generator JSON-LD Stripping

Removes "generator": "WordPress x.x.x" from JSON-LD structured data - complete version hiding across all content types

XML-RPC Multicall Detection

Identifies brute force attempts via system.multicall with 8KB+ payloads - blocks 90% of credential stuffing attacks. Adds 60 threat points

Dangerous Upload Detection

Scans async-upload.php Content-Type for PHP/MIME types - blocks malicious file uploads. Adds 80 threat points

Custom Login IP Blocklist

Multi-IP allowlist support for admin areas - CIDR notation not yet supported, explicit IPs only (configurable via LoginIPBlocklist array)

Response Header Hardening

Injects X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN, Referrer-Policy: strict-origin-when-cross-origin, X-XSS-Protection: 1; mode=block

Threat Score Per Attack Type

XMLRPC brute +60, Login brute +60, SQLi +50, XSS +40, Path traversal +40, Null byte +30, Scanner UA +50, Exploit path +50, PHP upload +70 - cumulative scoring enables smart blocking

Auto-Ban on Threshold

Configurable threat score threshold (default 100) triggers 30-minute IP ban - stops attacks before they succeed without permanent blocking

Logging & Forensics

Comprehensive logging includes timestamp, IP, method, URI, and reason. Optional LogAllBlocks for full audit trail - SIEM compatible

Low Performance Impact

All regex patterns pre-compiled, concurrent-safe maps with mutex locking, async threat score cleanup (30-min TTL) - handles 10K+ req/sec

How CloFix WAF uses it

💡 How it works: The WordPress protection engine intercepts requests before they reach your WordPress installation. It applies 35+ security checks in sequence - from early detection (scanner UAs, SQLi patterns, null bytes) to application-specific rules (XML-RPC blocking, login brute force, REST API rate limiting). Each violation adds threat points; reaching configurable threshold triggers temporary IP ban (default 30 minutes). Threat scores decay naturally after 30 minutes of clean behavior. The response path strips version fingerprints, emoji scripts, and feed links from HTML output. All regex patterns are pre-compiled at startup - performance impact under 1ms per request even on high-traffic WordPress sites.

Canonical URL: https://clofix.com/features/clofix-waf/wordpress-protection/