CVE-2023-4899

8.8 HIGH

📋 TL;DR

This SQL injection vulnerability in the Anything-LLM software allows attackers to execute arbitrary SQL commands through user input. It affects all deployments running versions prior to 0.0.1, potentially compromising database integrity and exposing sensitive information.

💻 Affected Systems

Products:
  • mintplex-labs/anything-llm
Versions: All versions prior to 0.0.1
Operating Systems: All platforms running the software
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments of the vulnerable versions regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data manipulation, and potential remote code execution via database functions.

🟠

Likely Case

Unauthorized data access, data modification, and potential privilege escalation within the database.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries in place.

🌐 Internet-Facing: HIGH - Web applications with SQL injection are prime targets for automated attacks.
🏢 Internal Only: MEDIUM - Internal attackers could still exploit this to gain unauthorized access.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection vulnerabilities are commonly exploited with automated tools and require minimal technical skill.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.0.1 and later

Vendor Advisory: https://github.com/mintplex-labs/anything-llm/commit/dc3dfbf31495fe316b21ee184b9317b38101d30e

Restart Required: Yes

Instructions:

1. Update to version 0.0.1 or later. 2. Apply the commit dc3dfbf31495fe316b21ee184b9317b38101d30e. 3. Restart the application service.

🔧 Temporary Workarounds

Input Validation Filter

all

Implement strict input validation to reject SQL injection patterns

Implement regex filtering for SQL keywords in user inputs

Web Application Firewall

all

Deploy WAF with SQL injection protection rules

Configure WAF to block SQL injection patterns

🧯 If You Can't Patch

  • Implement network segmentation to isolate the vulnerable system
  • Enable detailed SQL query logging and monitor for suspicious patterns

🔍 How to Verify

Check if Vulnerable:

Check if running version is earlier than 0.0.1 by examining package.json or application version

Check Version:

Check package.json for version field or application settings

Verify Fix Applied:

Verify the commit dc3dfbf31495fe316b21ee184b9317b38101d30e is applied and version is 0.0.1+

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in application logs
  • Multiple failed login attempts with SQL patterns

Network Indicators:

  • HTTP requests containing SQL keywords in parameters
  • Unusual database connection patterns

SIEM Query:

SELECT * FROM web_logs WHERE url_params CONTAINS 'UNION' OR url_params CONTAINS 'SELECT' OR url_params CONTAINS 'INSERT'

🔗 References

📤 Share & Export