Skip to main content
CVE Vulnerability Database

CVE-2025-3862: Contest Gallery WordPress XSS Vulnerability

CVE-2025-3862 is a stored XSS vulnerability in Contest Gallery WordPress plugin affecting versions up to 26.0.6. Authenticated attackers with Contributor access can inject malicious scripts. This article covers technical details, impact, and mitigation.

Published:

CVE-2025-3862 Overview

CVE-2025-3862 is a Stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in the Contest Gallery plugin for WordPress. The flaw affects all versions up to and including 26.0.6 and stems from insufficient input sanitization and output escaping on the id parameter within the cg_entry_on_off.php shortcode handler. Authenticated attackers holding Contributor-level access or above can inject arbitrary web scripts into pages. The injected payloads execute in the browser of any user who visits the affected page, enabling session theft, forced administrative actions, and redirection to attacker-controlled infrastructure.

Critical Impact

Contributor-level accounts can persist malicious JavaScript that executes against site visitors and privileged administrators, expanding compromise across the WordPress site.

Affected Products

  • Contest Gallery plugin for WordPress, versions up to and including 26.0.6
  • WordPress sites permitting Contributor-level (or higher) user registration
  • Plugin file: shortcodes/cg_entry_on_off.php

Discovery Timeline

  • 2025-05-08 - CVE-2025-3862 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-3862

Vulnerability Analysis

The vulnerability resides in the Contest Gallery plugin's shortcode processing logic at shortcodes/cg_entry_on_off.php. The id parameter is consumed by the shortcode handler and rendered back into page output without adequate sanitization or escaping. Because the payload is stored server-side within WordPress content, it executes each time a user renders the affected page.

Exploitation requires authentication at the Contributor role or higher. This lowers the barrier on WordPress sites that allow open registration or delegate content authorship to untrusted users. Successful exploitation permits arbitrary script execution in the security context of the victim's browser, including administrators viewing the injected content.

Root Cause

The root cause is missing input sanitization on the id shortcode attribute combined with missing output escaping when the value is emitted into HTML. WordPress provides helpers such as sanitize_text_field() and esc_attr() for exactly this scenario, but the vulnerable code path in versions up to 26.0.6 fails to apply them. The fix landed in version 26.0.7 via WordPress Changeset #3288915.

Attack Vector

An authenticated Contributor crafts a post or page containing the Contest Gallery shortcode with a malicious id value carrying JavaScript. When the page is submitted for review or published, the payload is stored in the WordPress database. Any user who later loads the page — including administrators previewing pending content — triggers execution of the attacker's script. Refer to the Wordfence Vulnerability Analysis and the vulnerable source at cg_entry_on_off.php (26.0.5) for technical specifics.

Detection Methods for CVE-2025-3862

Indicators of Compromise

  • Contest Gallery shortcodes containing id attributes with HTML characters such as <, >, ", or script
  • New or modified posts authored by Contributor accounts referencing the plugin's shortcodes
  • Unexpected outbound requests from administrator browsers to unfamiliar domains after previewing pending posts

Detection Strategies

  • Audit wp_posts for stored shortcode content containing suspicious id parameter values or encoded script payloads
  • Inspect web server access logs for POST requests to /wp-admin/post.php originating from Contributor-level accounts
  • Compare the deployed cg_entry_on_off.php against the patched version 26.0.7 to confirm remediation

Monitoring Recommendations

  • Enable file integrity monitoring on the wp-content/plugins/contest-gallery/ directory
  • Alert on privilege changes and creation of new Contributor or higher accounts
  • Monitor DOM-level events on published pages that render Contest Gallery shortcodes for injected <script> elements

How to Mitigate CVE-2025-3862

Immediate Actions Required

  • Upgrade Contest Gallery to version 26.0.7 or later immediately
  • Review all posts and pages created by Contributor-level users since the plugin was installed
  • Rotate credentials for any administrator account that previewed suspicious pending content

Patch Information

The vendor addressed the issue in Contest Gallery 26.0.7. The corrective commit is tracked in WordPress Changeset #3288915, with the fixed source viewable at cg_entry_on_off.php (26.0.7). Refer to the Contest Gallery Documentation and the WordPress Contest Gallery Developers Page for upgrade guidance.

Workarounds

  • Restrict Contributor-level access to trusted users only until patching is complete
  • Disable the Contest Gallery plugin on sites that permit open user registration until upgraded
  • Deploy a Web Application Firewall (WAF) rule to block shortcode payloads containing script tags in the id parameter
bash
# Update Contest Gallery via WP-CLI to the patched version
wp plugin update contest-gallery --version=26.0.7
wp plugin list --name=contest-gallery --fields=name,status,version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.