CVE-2025-5352: Stored XSS in lunary Analytics custom script injection
- Vendor
- Lunary
CVE-2025-5352 is a critical stored cross-site scripting vulnerability in the Analytics component of lunary-ai/lunary affecting versions up to 1.9.23. The issue arises because the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable is injected directly into the DOM via dangerouslySetInnerHTML without sanitization or validation. If an attacker can control that environment variable during deployment or through compromise of the server or deployment pipeline, they can supply arbitrary HTML/JavaScript that will be rendered and executed in users' browsers. Because the injected payload is stored in application configuration and served to all visitors, this is effectively a persistent XSS condition affecting all users of the instance until the malicious value is removed. The issue is reported fixed in version 1.9.25.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation enables arbitrary JavaScript execution in the browser context of users visiting the affected application. Depending on application behavior and browser context, this can enable session theft, account takeover, unauthorized actions on behalf of victims, exfiltration of sensitive application data accessible to the client, delivery of further malicious content, and persistent compromise of user interactions across the affected instance. Because the payload is served to all users, the blast radius can include the full user population of the deployment.
Mitigation
If you can’t patch tonight, do this now.
If immediate upgrade is not possible, disable or clear the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable and redeploy. Restrict who can modify deployment-time environment variables and harden CI/CD, hosting, and server administration paths to prevent configuration tampering. Apply a restrictive Content Security Policy where feasible to reduce script execution impact, although CSP may not fully mitigate intentionally injected inline script depending on policy. Monitor for unexpected changes to environment variables and inspect rendered analytics/custom script content for unauthorized payloads.
Remediation
Patch, then assume compromise.
Upgrade lunary-ai/lunary to version 1.9.25 or later, where the issue is fixed. In addition, remove any malicious or untrusted value from the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable, review deployment and CI/CD systems for unauthorized changes, and audit server-side configuration management for compromise. The vulnerable pattern of rendering untrusted content with dangerouslySetInnerHTML should be eliminated or protected with strict sanitization and allowlisting before any HTML is inserted into the DOM.
Exploits
No validated public exploits yet. Hidden: 1 rejected by Mallory's analysis as not a working exploit.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2025-5352 exploited in the wild?
- As of Sep 25, 2026, Mallory has no reports of CVE-2025-5352 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2025-5352?
- Yes. As of Sep 25, 2026, Mallory has reports of a public exploit for CVE-2025-5352.
- Is there a patch for CVE-2025-5352?
- Upgrade lunary-ai/lunary to version 1.9.25 or later, where the issue is fixed. In addition, remove any malicious or untrusted value from the NEXT_PUBLIC_CUSTOM_SCRIPT environment variable, review deployment and CI/CD systems for unauthorized changes, and audit server-side configuration management for compromise.
- What products are affected by CVE-2025-5352?
- Lunary.
- How severe is CVE-2025-5352?
- CVE-2025-5352 has a CVSS v3.1 score of 9.6 (Critical) and an EPSS score of 0.54% (46th percentile) as of Sep 25, 2026.
Recent activity
4 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.
No news coverage yet. Advisories and community discussion only.