CVE-2024-4151

8.1 HIGH

📋 TL;DR

An improper access control vulnerability in lunary-ai/lunary version 1.2.2 allows users to view and update any prompts in any projects due to insufficient access control checks in PATCH and GET requests for template versions. This enables unauthorized manipulation or access to sensitive project data, affecting all users of the vulnerable version.

💻 Affected Systems

Products:
  • lunary-ai/lunary
Versions: Version 1.2.2 specifically
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments using the vulnerable version; earlier or later versions may not be affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Malicious actors could modify or steal all prompt templates across all projects, leading to complete loss of data integrity and confidentiality, potentially enabling further attacks through manipulated prompts.

🟠

Likely Case

Unauthorized users accessing or modifying prompts they shouldn't have access to, leading to data leakage, prompt poisoning, or disruption of AI workflows.

🟢

If Mitigated

With proper access controls, users can only interact with prompts in projects they're authorized for, maintaining data segregation and integrity.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated user access but no special privileges; simple HTTP requests can trigger the vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit ddfd497afd017a6946c582a1a806687fdac888bf

Vendor Advisory: https://github.com/lunary-ai/lunary/commit/ddfd497afd017a6946c582a1a806687fdac888bf

Restart Required: Yes

Instructions:

1. Update to the latest version of lunary-ai/lunary. 2. Apply the specific commit ddfd497afd017a6946c582a1a806687fdac888bf if not updating fully. 3. Restart the lunary service.

🔧 Temporary Workarounds

Network segmentation

all

Restrict access to lunary instance to authorized users only using network controls.

API rate limiting

all

Implement rate limiting on PATCH and GET endpoints to reduce attack surface.

🧯 If You Can't Patch

  • Implement strict network access controls to limit who can reach the lunary instance.
  • Monitor all PATCH and GET requests to /api/template-versions/ endpoints for unauthorized access patterns.

🔍 How to Verify

Check if Vulnerable:

Check if running lunary version 1.2.2 by examining package version or deployment configuration.

Check Version:

Check package.json or deployment manifest for version 1.2.2

Verify Fix Applied:

Verify the commit hash includes ddfd497afd017a6946c582a1a806687fdac888bf or test that users cannot access prompts outside their authorized projects.

📡 Detection & Monitoring

Log Indicators:

  • Multiple PATCH or GET requests to /api/template-versions/ from single user across different project IDs
  • Access denied errors followed by successful access to unauthorized resources

Network Indicators:

  • Unusual patterns of template version requests from users
  • Requests to template endpoints with project IDs not associated with the user

SIEM Query:

source="lunary" AND (uri_path="/api/template-versions/*" AND user_id=* AND project_id NOT IN authorized_projects)

🔗 References

📤 Share & Export