Anti-Malware Security and Brute-Force Firewall <= 4.23.89 - Unauthenticated Stored Cross-Site Scripting
Description
The Anti-Malware Security and Brute-Force Firewall plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 4.23.89 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v4.23.90
Source Code
WordPress.org SVNThis exploitation research plan targets **CVE-2026-57691**, an unauthenticated stored cross-site scripting (XSS) vulnerability in the **Anti-Malware Security and Brute-Force Firewall** plugin for WordPress. --- ### 1. Vulnerability Summary * **Vulnerability:** Unauthenticated Stored XSS * **Lo…
Show full research plan
This exploitation research plan targets CVE-2026-57691, an unauthenticated stored cross-site scripting (XSS) vulnerability in the Anti-Malware Security and Brute-Force Firewall plugin for WordPress.
1. Vulnerability Summary
- Vulnerability: Unauthenticated Stored XSS
- Location: The vulnerability resides in the logging mechanism of the plugin's Firewall and Scan engine, specifically within the functions responsible for displaying "Threats" or "Firewall Blocks" in the admin dashboard (likely within
images/index.phpor the main settings rendering logic). - Cause: The plugin captures request metadata (such as the
User-AgentorREQUEST_URI) when a firewall event is triggered or a "Potential Threat" is identified. This data is stored in the WordPress options table (usingGOTMLS_update_option) and later rendered in the admin settings page (GOTMLS-settings) without sufficient output escaping (e.g., missingesc_html).
2. Attack Vector Analysis
- Endpoint: Any public-facing WordPress page (to trigger the firewall) or
wp-comments-post.php(to trigger the database scanner). - Vulnerable Parameter:
HTTP_USER_AGENTheader or the content of a public-facing database entry (like a comment). - Authentication: None (Unauthenticated).
- Preconditions: The Firewall must be active, or a scan must be initiated by the administrator to view the "threats."
3. Code Flow
- Entry (Unauthenticated): An attacker sends a crafted HTTP request that contains a known "threat" pattern (e.g., the string
eval(orpreg_replace(.../e)) to trigger the plugin's detection logic defined in$GLOBALS["GOTMLS"]["tmp"]["definitions_array"]. - Detection: The plugin's Firewall/Scanner (logic in
images/index.php) identifies the "threat." - Storage: The plugin logs the event. It captures the
User-Agentof the malicious request and stores it usingGOTMLS_update_option('scan_log', ...). - Admin View: An administrator navigates to the "Anti-Malware" settings page (
/wp-admin/admin.php?page=GOTMLS-settings). - Sink: The function
GOTMLS_load_scanlog(or similar logic) retrieves the log data. The storedUser-Agentis echoed directly into the HTML table of scan results without being passed throughesc_html()oresc_attr().
4. Nonce Acquisition Strategy
This vulnerability is exploited by injecting data that an administrator will later view. The injection phase is unauthenticated and does not require a nonce.
However, if the automated agent needs to verify the injection by simulating an admin view:
- Identify Variable: The plugin localizes its settings. Look for a variable like
GOTMLS_objectsorgotmls_admin_data. - Shortcode: The plugin primarily operates in the admin backend, but scripts are enqueued via
admin_enqueue_scripts. - Extraction:
- Navigate to:
/wp-admin/admin.php?page=GOTMLS-settings(as Admin). browser_eval("window.GOTMLS_objects?.nonce")(inferred).- The
GOTMLS_set_noncefunction inindex.phpsuggests a custom nonce system:$head_nonce = GOTMLS_set_nonce(__FUNCTION__."100");.
- Navigate to:
5. Exploitation Strategy
Step 1: Trigger Firewall via User-Agent Injection
We send a request that triggers the firewall's "Potential Threat" detection by including a signature (like eval() in the query string while placing the payload in the User-Agent.
- Tool:
http_request - URL:
http://localhost:8080/?s=eval(base64_decode('...')) - Method:
GET - Headers:
User-Agent: <img src=x onerror="alert('CVE-2026-57691_XSS')">
- Expected Response: The plugin may block the request or simply log the "Potential Threat."
Step 2: Trigger Scanner via "Tagged Code" (Alternative)
The plugin specifically looks for #TAG# ... #/TAG# patterns.
- Tool:
http_request - URL:
http://localhost:8080/wp-comments-post.php - Method:
POST - Body (URL-encoded):
comment=#GOTMLS# <script>alert(document.domain)</script> #/GOTMLS#&author=Attacker&email=attacker@example.com&comment_post_ID=1
6. Test Data Setup
- Ensure the Anti-Malware Security and Brute-Force Firewall plugin is active.
- (Optional) Enable "Brute-Force Protection" or "Firewall" options if not active by default.
- Create a standard post (ID: 1) to allow comment submission.
7. Expected Results
- The malicious
User-Agentor the content within the#GOTMLS#tags will be saved in theGOTMLS_scan_log_bloborGOTMLS_settings_arrayoption in the database. - When the administrator visits the "Scan Settings" page, the JavaScript
alert()will execute in their browser context.
8. Verification Steps
- WP-CLI Check: Verify the payload is stored in the options.
wp option get GOTMLS_scan_log_blob | grep "CVE-2026-57691_XSS" - Browser Verification:
- Navigate to
/wp-admin/admin.php?page=GOTMLS-settings. - Check for the
alertbox or inspect the DOM for the injected<img>tag.
- Navigate to
9. Alternative Approaches
- Request URI Vector: If the
User-Agentis sanitized, the plugin also definesGOTMLS_script_URIusing$_SERVER["REQUEST_URI"]. Attempt to inject into a URI fragment that bypasses thehtmlspecialcharsused inimages/index.php. - Referer Vector: Many security plugins log the
Refererheader. Send the payload in theRefererheader while triggering a firewall block.
Summary
The Anti-Malware Security and Brute-Force Firewall plugin is vulnerable to unauthenticated stored Cross-Site Scripting (XSS) due to insufficient sanitization of the 'mt' request parameter and improper construction of the 'GOTMLS_script_URI' constant. An attacker can inject a malicious payload into the request metadata which is stored in the scan logs and executed when an administrator views the plugin's settings or scan results.
Vulnerable Code
// images/index.php line 38 "mt" => ((isset($_REQUEST["mt"])&&GOTMLS_strlen($_REQUEST["mt"])==32)?$_REQUEST["mt"]:md5(microtime(true))), --- // images/index.php line 72 GOTMLS_define("GOTMLS_script_URI", preg_replace('/\&(last_)?mt=[0-9\.a-f]+/i', '', str_replace('&', '&', GOTMLS_htmlspecialchars($_SERVER["REQUEST_URI"], ENT_QUOTES))).'&mt='.$GLOBALS["GOTMLS"]["tmp"]["mt"]);
Security Fix
@@ -35,7 +35,7 @@ "pluginTitle" => "Anti-Malware", "default_encodings" => array('UTF-8', 'ISO-8859-1', 'windows-1252'), "skip_dirs" => array(".", ".."), "scanfiles" => array(), "nonce"=>array(), - "mt" => ((isset($_REQUEST["mt"])&&GOTMLS_strlen($_REQUEST["mt"])==32)?$_REQUEST["mt"]:md5(microtime(true))), + "mt" => ((isset($_REQUEST["mt"])&&preg_match('/^[0-9\.a-f]{32}$/is', $_REQUEST["mt"]))?$_REQUEST["mt"]:md5(microtime(true))), "threat_files" => array("htaccess"=>".htaccess","timthumb"=>"thumb.php"), "apache" => array(), "skip_ext"=>array("png", "jpg", "jpeg", "gif", "bmp", "tif", "tiff", "psd", "svg", "webp", "doc", "docx", "otf", "ttf", "fla", "flv", "mov", "mp3", "mp4", "pptx", "ppsx", "pdf", "css", "pot", "po", "mo", "so", "exe", "zip", "7z", "gz", "rar"), @@ -69,7 +69,7 @@ $GLOBALS["GOTMLS"]["tmp"]["protocol"] = "https:"; else $GLOBALS["GOTMLS"]["tmp"]["protocol"] = "http:"; -GOTMLS_define("GOTMLS_script_URI", preg_replace('/\&(last_)?mt=[0-9\.a-f]+/i', '', str_replace('&', '&', GOTMLS_htmlspecialchars($_SERVER["REQUEST_URI"], ENT_QUOTES))).'&mt='.$GLOBALS["GOTMLS"]["tmp"]["mt"]); +GOTMLS_define("GOTMLS_script_URI", preg_replace('/(^|\&)(last_)?mt=[^\&]++/i', '', str_replace('&', '&', GOTMLS_htmlspecialchars($_SERVER["REQUEST_URI"], ENT_QUOTES))).'&mt='.GOTMLS_htmlspecialchars($GLOBALS["GOTMLS"]["tmp"]["mt"])); GOTMLS_define("GOTMLS_plugin_home", "https://gotmls.net/"); if (function_exists("plugins_url")) GOTMLS_define("GOTMLS_images_path", GOTMLS_fix_url(plugins_url('/', __FILE__)));
Exploit Outline
The exploit targets the logging mechanism by supplying a malicious 'mt' parameter in an unauthenticated request that triggers a firewall log event. The attacker sends a request to any public page (e.g., `/?s=eval(`) with an `mt` parameter exactly 32 characters long containing an XSS payload (e.g., `"><script>alert(1)</script>AAAA`). Because the plugin only checked for a string length of 32 without validating the characters, this payload is appended to the `GOTMLS_script_URI` constant. When an administrator later views the scan logs in the 'Anti-Malware' settings page, the constant is echoed into the page source without further escaping, triggering the stored JavaScript.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.