CVE-2025-31385

7.1 HIGH

📋 TL;DR

A Cross-Site Request Forgery (CSRF) vulnerability in the WordPress Site Table of Contents plugin allows attackers to perform stored cross-site scripting (XSS) attacks. This affects WordPress sites using the plugin version 0.3 and earlier. Attackers can inject malicious scripts that execute when users visit affected pages.

💻 Affected Systems

Products:
  • WordPress Site Table of Contents plugin
Versions: 0.3 and earlier
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects WordPress installations with the vulnerable plugin activated.

⚠️ 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 malicious JavaScript that steals administrator credentials, redirects users to malicious sites, or performs actions on behalf of authenticated users, potentially leading to complete site compromise.

🟠

Likely Case

Attackers inject malicious scripts that steal user session cookies or credentials, potentially gaining administrative access to the WordPress site.

🟢

If Mitigated

With proper CSRF protections and content security policies, the attack surface is reduced, though the vulnerability still exists in the codebase.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires tricking authenticated users into visiting malicious pages, but the attack chain is straightforward once CSRF is achieved.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.4 or later

Vendor Advisory: https://patchstack.com/database/wordpress/plugin/site-table-of-contents/vulnerability/wordpress-site-table-of-contents-plugin-0-3-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 'Site Table of Contents' and click 'Update Now' if available. 4. If no update is available, deactivate and delete the plugin, then install version 0.4+ from WordPress repository.

🔧 Temporary Workarounds

Disable vulnerable plugin

all

Temporarily deactivate the Site Table of Contents plugin until patched

wp plugin deactivate site-table-of-contents

Implement CSRF protection headers

all

Add Content Security Policy headers to limit script execution

Add to .htaccess: Header set Content-Security-Policy "script-src 'self'"
Add to nginx config: add_header Content-Security-Policy "script-src 'self'";

🧯 If You Can't Patch

  • Disable the Site Table of Contents plugin immediately
  • Implement web application firewall rules to block suspicious POST requests to the plugin's endpoints

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin > Plugins > Installed Plugins for Site Table of Contents version

Check Version:

wp plugin get site-table-of-contents --field=version

Verify Fix Applied:

Verify plugin version is 0.4 or higher in WordPress admin panel

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /wp-admin/admin-ajax.php with plugin-specific actions
  • Multiple failed CSRF token validations for plugin endpoints

Network Indicators:

  • Suspicious JavaScript payloads in POST parameters to plugin endpoints
  • Unexpected iframe or script tags in plugin-generated content

SIEM Query:

source="wordpress.log" AND ("site-table-of-contents" OR "toc_" OR "ajax") AND (POST OR "admin-ajax")

🔗 References

📤 Share & Export