Skip to content
Heist/ feed
Back to feed
Critical

Command Injection in run-llama/llama_index

Type: advisorySources: OSV

A command injection vulnerability exists in the run-llama/llama_index repository, specifically within the safe_eval function. Attackers can bypass the intended security mechanism, which checks for the presence of underscores in code generated by LLM, to execute arbitrary code. This is achieved by crafting input that does not contain an underscore but still results in the execution of OS commands. The vulnerability allows for remote code execution (RCE) on the server hosting the application.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-3271
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 16:27 UTC · Revision 1

Source evidence

Command Injection in run-llama/llama_index

core-osv · Original source

Published 16 Apr 2024, 00:00 UTC

A command injection vulnerability exists in the run-llama/llama_index repository, specifically within the safe_eval function. Attackers can bypass the intended security mechanism, which checks for the presence of underscores in code generated by LLM, to execute arbitrary code. This is achieved by crafting input that does not contain an underscore but still results in the execution of OS commands. The vulnerability allows for remote code execution (RCE) on the server hosting the application.

osv:CVE-2024-3271
Complete source record
{
  "id": "4bb06baad4cfa0e31dcd73e88702c06e6b7c0d8c986683329ee99fa9d66c6d37",
  "url": "https://osv.dev/vulnerability/CVE-2024-3271",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Command Injection in run-llama/llama_index",
    "summary": "A command injection vulnerability exists in the run-llama/llama_index repository, specifically within the safe_eval function. Attackers can bypass the intended security mechanism, which checks for the presence of underscores in code generated by LLM, to execute arbitrary code. This is achieved by crafting input that does not contain an underscore but still results in the execution of OS commands. The vulnerability allows for remote code execution (RCE) on the server hosting the application.",
    "evidence": "osv:CVE-2024-3271",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2024-3271",
      "aliases": [
        "CVE-2024-3271",
        "GHSA-r6gp-rff2-p3hf",
        "PYSEC-2026-396"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/run-llama/llama_index",
              "type": "GIT",
              "events": [
                {
                  "introduced": "8b8199f82efb3ae8e9f9edca33e7d1cd76cfa9ad"
                },
                {
                  "fixed": "8a8324008764a7fefb6f25b0e3aac81089590322"
                },
                {
                  "fixed": "5fbcb5a8b9f20f81b791c7fc8849e352613ab475"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:llamaindex:llamaindex:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.10.6"
                      },
                      {
                        "fixed": "0.10.26"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "5fbcb5a8b9f20f81b791c7fc8849e352613ab475"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.10.25",
            "v0.10.24",
            "v0.10.23",
            "v0.10.22",
            "v0.10.20",
            "v0.10.19",
            "v0.10.18",
            "v0.10.17",
            "v0.10.16",
            "v0.10.15",
            "v0.10.14",
            "v0.10.13.post1",
            "v0.10.13",
            "v0.10.12",
            "v0.10.11",
            "v0.10.10",
            "v0.10.9",
            "v0.10.8",
            "v0.10.7",
            "v0.10.6"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-3271.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:21.292769695Z",
      "provider": "osv",
      "references": [
        "https://huntr.com/bounties/9b32490e-7cf9-470e-8d49-ba083ae7a279",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/3xxx/CVE-2024-3271.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-3271",
        "https://github.com/run-llama/llama_index/commit/5fbcb5a8b9f20f81b791c7fc8849e352613ab475"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-77"
        ],
        "cna_assigner": "@huntr_ai",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "10.26"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "SplitRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/3xxx/CVE-2024-3271.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-3271",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 487136,
  "published_at": "2024-04-16T00:00:15.108+00:00"
}