CVE-2024-3903

7.1 HIGH

📋 TL;DR

This vulnerability in the Add Custom CSS and JS WordPress plugin allows attackers to perform Cross-Site Request Forgery (CSRF) attacks that inject malicious JavaScript code (Stored XSS) into WordPress sites. Attackers can exploit this to hijack admin sessions, deface websites, or steal sensitive data when logged-in users with author privileges or higher visit malicious pages. All WordPress sites using vulnerable versions of this plugin are affected.

💻 Affected Systems

Products:
  • Add Custom CSS and JS WordPress plugin
Versions: All versions through 1.20
Operating Systems: All operating systems running WordPress
Default Config Vulnerable: ⚠️ Yes
Notes: Requires at least author-level privileges in WordPress to exploit. The plugin must be active and in use.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could gain administrative access to the WordPress site, install backdoors, steal sensitive data, deface the website, or use the site for further attacks against visitors.

🟠

Likely Case

Attackers inject malicious JavaScript that steals session cookies or redirects users to phishing sites when logged-in users with appropriate privileges visit compromised pages.

🟢

If Mitigated

With proper security controls like web application firewalls and user awareness training, exploitation attempts would be blocked or detected before causing significant damage.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires tricking a logged-in user with author privileges or higher to click a malicious link. No authentication bypass is needed beyond the initial user interaction.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.21 or later

Vendor Advisory: https://wpscan.com/vulnerability/0a0e7bd4-948d-47c9-9219-380bda9f3034/

Restart Required: No

Instructions:

1. Log into WordPress admin panel. 2. Navigate to Plugins > Installed Plugins. 3. Find 'Add Custom CSS and JS' plugin. 4. Click 'Update Now' if update is available. 5. Alternatively, download version 1.21+ from WordPress repository and replace the plugin files.

🔧 Temporary Workarounds

Disable vulnerable plugin

all

Temporarily disable the Add Custom CSS and JS plugin until patched

wp plugin deactivate add-custom-css-and-js

Implement CSRF protection

all

Add CSRF tokens to WordPress forms using security plugins

🧯 If You Can't Patch

  • Remove the Add Custom CSS and JS plugin completely and use alternative methods for custom CSS/JS
  • Implement strict Content Security Policy (CSP) headers to block inline JavaScript execution

🔍 How to Verify

Check if Vulnerable:

Check WordPress admin panel > Plugins > Installed Plugins for 'Add Custom CSS and JS' version 1.20 or earlier

Check Version:

wp plugin get add-custom-css-and-js --field=version

Verify Fix Applied:

Verify plugin version is 1.21 or higher in WordPress admin panel

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests to /wp-admin/admin-ajax.php with custom_css or custom_js parameters
  • Multiple failed CSRF token validation attempts in WordPress logs

Network Indicators:

  • Unexpected JavaScript injection in plugin settings pages
  • Suspicious outbound connections from WordPress admin pages

SIEM Query:

source="wordpress.log" AND ("custom_css" OR "custom_js") AND status=200

🔗 References

📤 Share & Export