CVE-2025-7894

6.3 MEDIUM

📋 TL;DR

This critical SQL injection vulnerability in Onyx's chat interface allows attackers to execute arbitrary SQL commands through the generate_simple_sql function. It affects Onyx versions up to 0.29.1 and can be exploited remotely without authentication.

💻 Affected Systems

Products:
  • Onyx
Versions: up to 0.29.1
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the chat interface component specifically in the SQL generation function.

📦 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 exfiltration, and potential privilege escalation within the database.

🟢

If Mitigated

Limited impact with proper input validation and database permission restrictions in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploit details are publicly available and SQL injection is a well-understood attack vector.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: None available

Restart Required: No

Instructions:

No official patch available. Vendor has not responded to disclosure. Consider workarounds or alternative solutions.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and parameterized queries in the generate_simple_sql function

# Modify backend/onyx/agents/agent_search/kb_search/nodes/a3_generate_simple_sql.py to use parameterized queries

Web Application Firewall Rules

all

Deploy WAF rules to block SQL injection patterns

# Example ModSecurity rule: SecRule ARGS "@detectSQLi" "id:1001,phase:2,deny"

🧯 If You Can't Patch

  • Isolate the vulnerable system from internet access and restrict internal network access
  • Implement database-level controls: use least privilege accounts, enable audit logging, and restrict database functions

🔍 How to Verify

Check if Vulnerable:

Check Onyx version: if version ≤ 0.29.1 and chat interface is enabled, system is vulnerable

Check Version:

Check Onyx configuration or package manager for version information

Verify Fix Applied:

Test SQL injection attempts against the chat interface; successful exploitation indicates vulnerability

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts via chat interface
  • Unexpected database schema changes

Network Indicators:

  • SQL keywords in HTTP POST requests to chat endpoints
  • Unusual database connection patterns

SIEM Query:

source="web_logs" AND (url="*/chat*" OR url="*/search*") AND (query="UNION" OR query="SELECT *" OR query="DROP" OR query="INSERT")

🔗 References

📤 Share & Export