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.
The NEXT_PUBLIC_CUSTOM_SCRIPT environment variable is injected directly into the DOM using the dangerouslySetInnerHTML mechanism in React, which deliberately bypasses built-in XSS protections. An attacker who gains control over this environment variable during application deployment or as a result of server compromise can embed arbitrary JavaScript code. The malicious script is then executed in the browsers of all users visiting the application and remains active until the environment variable is cleared.
An attacker can cause complete account takeover, data exfiltration, distribution of malicious software, and conduct persistent attacks affecting all users of the application.
Update Lunary to version 1.9.25, in which the issue has been fixed. Additionally, it is recommended to review and verify currently set environment variables for the presence of malicious scripts.
Lunary (lunary-ai/lunary) in versions up to and including 1.9.23
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HLunary
APPLunary< 1.9.25
Related vulnerabilities
Brak kontroli dostępu w API BigQuery — eksport całej bazy danych w Lunary
SQL Injection w trasie /api/v1/external-users aplikacji Lunary
Lunary: brak kontroli dostępu do konfiguracji SAML (nieautoryzowana zmiana)
Błąd autoryzacji w Lunary umożliwiający pełny dostęp do projektów
SSRF w Lunary – nieautoryzowane żądania przez endpoint SAML IdP