CVE-2025-31399

7.1 HIGH

📋 TL;DR

A Cross-Site Request Forgery (CSRF) vulnerability in the Chandan Garg CG Scroll To Top WordPress plugin allows attackers to inject malicious scripts that become stored cross-site scripting (XSS) payloads. This affects WordPress sites using CG Scroll To Top plugin versions up to 3.5. Attackers can trick authenticated administrators into executing actions that inject persistent malicious scripts.

💻 Affected Systems

Products:
  • Chandan Garg CG Scroll To Top WordPress Plugin
Versions: n/a through 3.5
Operating Systems: Any OS running WordPress
Default Config Vulnerable: ⚠️ Yes
Notes: Requires WordPress installation with the vulnerable plugin activated. Attack requires tricking authenticated users with plugin management privileges.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could inject persistent malicious JavaScript that steals administrator credentials, redirects users to malicious sites, or takes full control of the WordPress site when administrators view affected pages.

🟠

Likely Case

Attackers create fake requests that trick logged-in administrators into saving malicious JavaScript in plugin settings, leading to persistent XSS that affects all users visiting pages with the malicious script.

🟢

If Mitigated

With proper CSRF tokens and input validation, the attack would fail as legitimate requests would be rejected without proper authentication tokens.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploit requires social engineering to trick authenticated users into clicking malicious links. The vulnerability chain (CSRF to Stored XSS) is well-documented and weaponization is likely given the prevalence of WordPress attacks.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.6 or later

Vendor Advisory: https://patchstack.com/database/wordpress/plugin/cg-scroll-to-top/vulnerability/wordpress-cg-scroll-to-top-plugin-3-5-csrf-to-stored-xss-vulnerability?_s_id=cve

Restart Required: No

Instructions:

1. Log into WordPress admin panel. 2. Navigate to Plugins > Installed Plugins. 3. Find 'CG Scroll To Top' plugin. 4. Click 'Update Now' if update available. 5. If no update available, deactivate and delete the plugin, then install version 3.6+ from WordPress repository.

🔧 Temporary Workarounds

Disable Plugin

all

Temporarily disable the vulnerable plugin until patched version is available

wp plugin deactivate cg-scroll-to-top

Implement CSRF Protection

all

Add custom CSRF tokens to plugin forms if you must keep vulnerable version

🧯 If You Can't Patch

  • Remove plugin management capabilities from users who don't absolutely need them
  • Implement web application firewall (WAF) rules to block suspicious POST requests to plugin endpoints

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin > Plugins > Installed Plugins for 'CG Scroll To Top' version. If version is 3.5 or earlier, you are vulnerable.

Check Version:

wp plugin get cg-scroll-to-top --field=version

Verify Fix Applied:

After update, verify plugin version shows 3.6 or later in WordPress admin plugins list.

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /wp-admin/admin-ajax.php with plugin-specific actions
  • Multiple failed CSRF validation attempts

Network Indicators:

  • Suspicious outbound connections from WordPress site to unknown domains after plugin settings changes

SIEM Query:

source="wordpress.log" AND (uri="/wp-admin/admin-ajax.php" AND action CONTAINS "cg_scroll")

🔗 References

📤 Share & Export