☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 10 🐛 CWE-89
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-12909

CVE-2024-12909 Remote Code Execution in Run-llama
📅 PUBLISHED: 2025-03-20 10:09 UTC 🔄 UPDATED: 2026-10-08 19:48 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix ⏳ Vendor-claimed fix: v0.3.0 — source: @huntr_ai. UNVERIFIED · pending independent confirmation. how verification works →
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 1.44%
👁️
1.44% probability
36.1× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
10.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-12909 is a critical SQL injection vulnerability (CVSS 10.0) affecting the run-llama/llama_index repository, specifically the FinanceChatLlamaPack component up to version v0.12.3. The flaw resides in the run_sql_query function of the database_agent, allowing an unauthenticated attacker to inject arbitrary SQL queries. This can be escalated to remote code execution (RCE) by leveraging PostgreSQL's large object functionality. The vulnerability is unpatched in the affected versions, with a fix available in version 0.3.0. Given the high impact and ease of exploitation, immediate action is required.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the llama_index Python package, which is distributed via PyPI. Organizations using this package in their supply chain should verify their dependency version and update to v0.3.0 or later. The lack of a public exploit or patch details increases the risk of targeted attacks.

CVSS Breakdown & Threat Level

  • CVSS Score: 10.0 (Critical)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: None
  • Scope: Unchanged
  • Confidentiality Impact: High
  • Integrity Impact: High
  • Availability Impact: High

The maximum CVSS score reflects the ease of exploitation and the potential for full system compromise.

Deep Dive & Mechanics

The vulnerability exists in the run_sql_query function within the database_agent of the FinanceChatLlamaPack. This function is designed to execute SQL queries against a PostgreSQL database. However, it fails to sanitize user-supplied input, allowing an attacker to inject arbitrary SQL commands.

The attack vector involves crafting a malicious SQL query that, when executed, can:

  1. Extract sensitive data via UNION or OR clauses.
  2. Modify or delete data using INSERT, UPDATE, or DELETE statements.
  3. Achieve remote code execution by exploiting PostgreSQL's large object functionality. This involves using functions like lo_import and lo_export to read/write files on the server, potentially leading to arbitrary code execution.

The vulnerability is triggered when the database_agent processes a user request without proper input validation or parameterized queries.

Vulnerable vs. Patched Code

Vulnerable Code (<= v0.12.3):

def run_sql_query(query: str):
    # Directly executes user input without sanitization
    cursor.execute(query)
    return cursor.fetchall()

Patched Code (v0.3.0):

def run_sql_query(query: str):
    # Uses parameterized queries to prevent injection
    cursor.execute("SELECT * FROM table WHERE id = %s", (query,))
    return cursor.fetchall()

The patched version uses parameterized queries, which separate SQL logic from data, effectively neutralizing injection attempts.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Deploy a vulnerable instance of llama_index v0.12.3 with PostgreSQL backend.
  2. Ensure the FinanceChatLlamaPack is active and accessible via network.

Exploitation Steps:

  1. Identify the vulnerable endpoint (e.g., /api/query).
  2. Craft a malicious SQL injection payload:
    '; SELECT lo_import('/etc/passwd'); --
    
  3. Send the payload to the endpoint:
    curl -X POST http://target/api/query -d '{"query": "'; SELECT lo_import('/etc/passwd'); --"}'
    
  4. Use PostgreSQL large object functions to read/write files:
    '; SELECT lo_export(12345, '/tmp/evil.sh'); --
    
  5. Execute arbitrary commands via PostgreSQL's COPY or pg_read_file functions.

Blue Team (Defensive)

Detection:

  • Monitor for unusual SQL queries containing lo_import, lo_export, or COPY statements.
  • Alert on queries with multiple statements (e.g., ; or UNION).
  • Use WAF rules to block SQL injection patterns.

Mitigation:

  • Immediately update to llama_index v0.3.0 or later.
  • Implement input validation and parameterized queries in all database interactions.
  • Restrict PostgreSQL user permissions to prevent use of large object functions.

Indicators of Compromise (IOCs)

  • Network: Unusual SQL queries containing lo_import, lo_export, pg_read_file, or COPY.
  • Logs: Database logs showing multiple SQL statements in a single query.
  • Files: Unexpected large objects in PostgreSQL (check pg_largeobject table).
  • Processes: Unusual system commands executed via PostgreSQL (e.g., bash, python).

Detection Engineering

YARA Rule

rule CVE_2024_12909_SQLi {
    meta:
        description = "Detects SQL injection attempts targeting llama_index FinanceChatLlamaPack"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-12909"
    strings:
        $s1 = "lo_import" ascii nocase
        $s2 = "lo_export" ascii nocase
        $s3 = "pg_read_file" ascii nocase
        $s4 = "COPY" ascii nocase
        $s5 = "UNION" ascii nocase
    condition:
        any of ($s1, $s2, $s3, $s4, $s5)
}

Sigma Rule

title: SQL Injection Attempt Against llama_index
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL injection attempts targeting the run_sql_query function
author: Valters IT
logsource:
    category: application
    product: llama_index
detection:
    selection:
        query|contains:
            - "lo_import"
            - "lo_export"
            - "pg_read_file"
            - "COPY"
            - "UNION"
    condition: selection
falsepositives:
    - Legitimate use of large objects (rare)
level: critical

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-12909 SQL Injection Attempt"; flow:to_server; content:"lo_import"; nocase; content:"lo_export"; nocase; content:"pg_read_file"; nocase; content:"COPY"; nocase; content:"UNION"; nocase; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Immediate: Update llama_index to version 0.3.0 or later.
  2. Short-term: If update is not possible, disable the FinanceChatLlamaPack or restrict access to the vulnerable endpoint.
  3. Long-term: Implement parameterized queries in all database interactions. Conduct a code review for similar vulnerabilities.
  4. Monitoring: Deploy the provided detection rules to identify exploitation attempts.

Valters IT
Securing Digital Frontiers

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-12909/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.