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-2024-5131 Overview
CVE-2024-5131 is an Improper Access Control vulnerability in the lunary-ai/lunary repository, an open-source observability platform for Large Language Model (LLM) applications. The flaw affects versions up to and including 1.2.2 and allows an authenticated user to retrieve prompts belonging to other projects by supplying a specific prompt ID to an endpoint that does not verify ownership. The issue is tracked under CWE-639: Authorization Bypass Through User-Controlled Key and was fixed in version 1.2.25.
Critical Impact
Any authenticated Lunary user can read arbitrary prompts across projects, exposing proprietary LLM prompt templates and potentially sensitive data embedded within them.
Affected Products
- lunary-ai/lunary versions up to and including 1.2.2
- Self-hosted Lunary deployments running vulnerable releases
- Any multi-tenant Lunary instance sharing prompts across projects
Discovery Timeline
- 2024-06-06 - CVE-2024-5131 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-5131
Vulnerability Analysis
Lunary exposes a prompt-retrieval endpoint that accepts a prompt identifier as a user-controlled parameter. In vulnerable releases, the endpoint resolves the prompt by ID without confirming that the prompt belongs to a project the requesting user owns or has access to. An authenticated attacker can enumerate or guess prompt IDs and retrieve prompts from unrelated projects.
This is a classic Insecure Direct Object Reference (IDOR) pattern. The server trusts the client-supplied key, performing authentication but skipping authorization. Because prompts in LLM applications often contain proprietary instructions, system context, fine-tuning data, or embedded secrets, cross-tenant exposure can leak intellectual property and operational logic.
The fix landed in commit ddfd497afd017a6946c582a1a806687fdac888bf, which enforces ownership checks before returning prompt data.
Root Cause
The vulnerable endpoint performs object lookup by the prompt ID submitted in the request. It does not join against the current user's project membership or verify that the prompt's parent project matches the caller's scope. Authorization logic is effectively reduced to session validity, leaving object-level access control absent.
Attack Vector
Exploitation requires network access to the Lunary API and valid low-privilege credentials. The attacker issues a request to the prompt endpoint and substitutes a target prompt ID. Successful requests return the full prompt object regardless of project ownership. No user interaction and no elevated privileges are required.
See the Huntr bounty disclosure for additional technical context on the vulnerable endpoint and reproduction steps.
Detect Identity Attacks the Moment Authentication Fails
Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.
Stop Identity AttacksDetection Methods for CVE-2024-5131
Indicators of Compromise
- Repeated requests to Lunary prompt-retrieval endpoints with sequential or enumerated prompt identifiers
- API access patterns where a single user account retrieves prompts associated with multiple projects it does not own
- Unusual spikes in successful GET responses from prompt endpoints originating from a single session or API key
Detection Strategies
- Review Lunary application logs for prompt ID access patterns that cross project boundaries
- Correlate authenticated session identifiers with the project ownership of accessed prompt IDs
- Alert on brute-force style enumeration of UUID or integer prompt identifiers
Monitoring Recommendations
- Enable verbose API logging on self-hosted Lunary instances and forward logs to a centralized analytics platform
- Track per-user access rates against prompt endpoints and baseline normal behavior
- Monitor for post-authentication IDOR patterns across all multi-tenant services, not just Lunary
How to Mitigate CVE-2024-5131
Immediate Actions Required
- Upgrade Lunary to version 1.2.25 or later immediately
- Audit prompt-access logs for signs of cross-project retrieval prior to patching
- Rotate any secrets, API keys, or credentials that may have been embedded in exposed prompts
- Review and restrict account provisioning on shared Lunary instances until the patch is applied
Patch Information
The maintainers resolved CVE-2024-5131 in Lunary 1.2.25. The remediation commit is ddfd497afd017a6946c582a1a806687fdac888bf, which adds ownership verification to prompt retrieval. Operators of self-hosted deployments should pull the latest release and redeploy.
Workarounds
- Restrict Lunary API exposure to trusted networks using a reverse proxy or VPN until patching is complete
- Limit account creation to known users and disable guest or self-service registration where possible
- Place a web application firewall (WAF) in front of Lunary to rate-limit and inspect prompt endpoint traffic
# Upgrade self-hosted Lunary to a fixed release
git fetch --tags
git checkout v1.2.25
npm install
npm run build
npm run start
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

