Skip to main content

CVE-2025-5352: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in lunary-ai lunary-ai/lunary

High
VulnerabilityCVE-2025-5352cvecve-2025-5352cwe-79
Published: Sat Aug 23 2025 (08/23/2025, 06:56:09 UTC)
Source: CVE Database V5
Vendor/Project: lunary-ai
Product: lunary-ai/lunary

Description

A critical stored Cross-Site Scripting (XSS) vulnerability exists in the Analytics component of lunary-ai/lunary versions up to 1.9.23, where the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable is directly injected into the DOM using dangerouslySetInnerHTML without any sanitization or validation. This allows arbitrary JavaScript execution in all users' browsers if an attacker can control the environment variable during deployment or through server compromise. The vulnerability can lead to complete account takeover, data exfiltration, malware distribution, and persistent attacks affecting all users until the environment variable is cleaned. The issue is fixed in version 1.9.25.

AI-Powered Analysis

AILast updated: 08/23/2025, 07:17:57 UTC

Technical Analysis

CVE-2025-5352 is a critical stored Cross-Site Scripting (XSS) vulnerability identified in the Analytics component of the lunary-ai/lunary software, affecting versions up to 1.9.23. The root cause of this vulnerability lies in the unsafe handling of the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable, which is directly injected into the Document Object Model (DOM) using React's dangerouslySetInnerHTML property without any sanitization or validation. This practice violates secure coding principles and allows an attacker who can control the environment variable—either during deployment or via server compromise—to inject arbitrary JavaScript code that executes in the browsers of all users accessing the affected application. The stored nature of this XSS means the malicious script persists and affects all users until the environment variable is corrected or sanitized. Potential consequences include complete account takeover, unauthorized data exfiltration, distribution of malware, and persistent attacks that can compromise user trust and system integrity. The vulnerability has been assigned a CVSS v3.0 score of 8.1, indicating high severity, with attack vector as network, high attack complexity, no privileges required, no user interaction needed, and impacts on confidentiality, integrity, and availability. The issue is resolved in lunary-ai/lunary version 1.9.25, where presumably proper sanitization or validation of the environment variable input is implemented to prevent script injection.

Potential Impact

For European organizations using lunary-ai/lunary in their analytics infrastructure, this vulnerability poses a significant risk. Exploitation could lead to widespread compromise of user accounts and sensitive analytics data, potentially exposing personal data protected under GDPR regulations. The ability to execute arbitrary JavaScript in users' browsers can facilitate phishing, session hijacking, and malware distribution campaigns targeting employees or customers. Persistent XSS can undermine trust in the affected service and cause reputational damage. Additionally, if the environment variable is compromised via server breach, attackers gain a persistent foothold affecting all users, increasing the attack surface and complicating incident response. The high severity and network exploitability mean attackers can remotely exploit this without authentication or user interaction, raising the urgency for European organizations to address this vulnerability promptly to avoid regulatory penalties and operational disruptions.

Mitigation Recommendations

European organizations should immediately upgrade lunary-ai/lunary to version 1.9.25 or later where the vulnerability is fixed. If upgrading is not immediately feasible, organizations should implement strict controls around environment variable management, ensuring that NEXT_PUBLIC_CUSTOM_SCRIPT cannot be influenced by untrusted sources. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) configured to detect and block suspicious script injections targeting the Analytics component. Conduct thorough code reviews and penetration testing focusing on client-side injection points. Additionally, implement Content Security Policy (CSP) headers to restrict the execution of inline scripts and reduce the impact of any injected malicious code. Monitoring and alerting for unusual environment variable changes or unexpected script execution patterns can also help detect exploitation attempts early. Finally, educate deployment and DevOps teams on secure environment variable handling and the risks of injecting unsanitized data into the DOM.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
@huntr_ai
Date Reserved
2025-05-30T08:23:15.862Z
Cvss Version
3.0
State
PUBLISHED

Threat ID: 68a96797ad5a09ad0027ba9c

Added to database: 8/23/2025, 7:02:47 AM

Last enriched: 8/23/2025, 7:17:57 AM

Last updated: 8/23/2025, 8:04:43 AM

Views: 6

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats