Skip to main content
Vulnerability Database/CVE-2025-40640

CVE-2025-40640: Energy CRM Stored XSS Vulnerability

CVE-2025-40640 is a stored cross-site scripting flaw in Energy CRM v2025 that enables attackers to inject malicious scripts and steal user session cookies. This article covers the technical details, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-40640 Overview

CVE-2025-40640 is a stored Cross-Site Scripting (XSS) vulnerability in Energy CRM v2025 developed by Status Tracker Ltd. The flaw exists in the /crm/create_invoice_submit.php endpoint, which fails to validate or sanitize the customerName_0 parameter in POST requests. An authenticated attacker can inject malicious JavaScript that executes in the browser context of other authenticated users who view the stored content. Successful exploitation enables session cookie theft, account takeover, and additional client-side attacks against CRM users. The weakness is classified under CWE-79: Improper Neutralization of Input During Web Page Generation.

Critical Impact

Attackers with low-privilege authenticated access can inject persistent JavaScript that steals session cookies from any user who loads the affected invoice page.

Affected Products

  • Energy CRM v2025 by Status Tracker Ltd
  • Component: /crm/create_invoice_submit.php
  • Vulnerable parameter: customerName_0

Discovery Timeline

  • 2025-10-10 - CVE-2025-40640 published to NVD
  • 2026-10-08 - Last updated in NVD database

Technical Details for CVE-2025-40640

Vulnerability Analysis

The vulnerability is a stored (persistent) XSS condition in the invoice creation workflow of Energy CRM v2025. When a user submits an invoice through the /crm/create_invoice_submit.php endpoint, the application accepts the customerName_0 POST parameter without proper input validation or output encoding. The attacker-supplied payload is persisted in the application database and later rendered to any user who views invoice records containing the malicious content.

Because the payload executes in the context of an authenticated user's session, an attacker can harvest session cookies, perform actions on behalf of the victim, pivot into higher-privileged accounts, or stage further social engineering. Exploitation requires low privileges and some user interaction, consistent with the stored nature of the attack.

Root Cause

The root cause is missing server-side input validation and missing contextual output encoding in the invoice submission handler. The application trusts the customerName_0 field as benign text and later renders it into HTML pages without neutralizing characters such as <, >, and ". This allows arbitrary HTML and JavaScript to be embedded into the rendered DOM.

Attack Vector

The attack is network-reachable and requires an authenticated low-privileged account on the CRM. The attacker submits a crafted POST request to /crm/create_invoice_submit.php containing a JavaScript payload inside the customerName_0 parameter. When a legitimate user, including administrators, opens the invoice view, the script executes under their origin and can exfiltrate document.cookie, session tokens, or CSRF tokens to an attacker-controlled host.

No verified public proof-of-concept code is available. See the INCIBE Security Notice on CRM Vulnerabilities for the vendor coordination details.

Detection Methods for CVE-2025-40640

Indicators of Compromise

  • POST requests to /crm/create_invoice_submit.php with HTML or JavaScript syntax in the customerName_0 parameter, such as <script>, onerror=, or javascript: tokens.
  • Outbound HTTP requests from user browsers to unknown external domains originating from CRM invoice pages.
  • Invoice records in the database containing angle brackets, event handlers, or encoded script fragments in customer name fields.

Detection Strategies

  • Inspect web server and application logs for POST bodies to the invoice submission endpoint containing XSS payload signatures.
  • Deploy a Web Application Firewall (WAF) rule to flag reflected and stored XSS patterns targeting the customerName_0 parameter.
  • Perform periodic database scans of invoice tables for stored HTML tags or script-like substrings in text fields.

Monitoring Recommendations

  • Monitor authentication events for unusual session reuse from new IP addresses or user-agents, indicating potential cookie theft.
  • Alert on Content Security Policy (CSP) violation reports originating from CRM pages that render invoice data.
  • Track anomalous activity by low-privileged CRM accounts, including repeated invoice creation attempts with unusual payloads.

How to Mitigate CVE-2025-40640

Immediate Actions Required

  • Contact Status Tracker Ltd to obtain a patched release of Energy CRM and apply it to all production instances.
  • Restrict access to /crm/create_invoice_submit.php to trusted internal networks or VPN-connected users until a fix is deployed.
  • Rotate session cookies and credentials for any user who may have viewed invoices created by untrusted accounts.
  • Review existing invoice records and remove entries containing HTML or JavaScript content in customer name fields.

Patch Information

No vendor patch URL is published in the available NVD references. Consult the INCIBE Security Notice on CRM Vulnerabilities for coordinated disclosure information and contact Status Tracker Ltd directly for a remediated build.

Workarounds

  • Deploy a WAF rule that strips or blocks HTML metacharacters in the customerName_0 POST parameter.
  • Enforce a strict Content Security Policy that disallows inline scripts and restricts script sources to trusted origins.
  • Set the HttpOnly and Secure attributes on session cookies to limit cookie theft via JavaScript.
  • Require multi-factor authentication for all CRM accounts to reduce impact of session hijacking.
bash
# Example WAF rule (ModSecurity) to block XSS payloads on the vulnerable endpoint
SecRule REQUEST_URI "@streq /crm/create_invoice_submit.php" \
  "phase:2,chain,deny,status:403,id:1004064,msg:'Potential XSS in customerName_0'"
  SecRule ARGS:customerName_0 "@rx (?i)(<script|onerror=|onload=|javascript:)" \
    "t:none,t:urlDecodeUni,t:htmlEntityDecode"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.