llama-index-core insecurely handles temporary files
The llama-index-core package uses a predictable, hardcoded temporary directory on Linux without proper security controls. An attacker on a multi-user system could steal proprietary models, poison cached embeddings, or conduct symlink attacks.
run-llama/llama_index
Originally disclosed on huntr
The llama-index-core package, up to version 0.12.44, contains a vulnerability in the get_cache_dir() function where a predictable, hardcoded directory path /tmp/llama_index is used on Linux systems without proper security controls. This vulnerability allows attackers on multi-user systems to steal proprietary models, poison cached embeddings, or conduct symlink attacks. The issue affects all Linux deployments where multiple users share the same system. The vulnerability is classified under CWE-379, CWE-377, and CWE-367, indicating insecure temporary file creation and potential race conditions.
From the GitHub Advisory Database (GHSA-cr7q-2w66-hjcm, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
On shared Linux systems, an attacker could steal proprietary models, poison cached embeddings, or conduct symlink attacks.
What the attacker needed
Multi-user Linux system; attacker has local access
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program needs a temporary place to store files, it should create a private folder that only its own user can access. This package instead always uses the same folder name in a shared location, so other users on the same computer can guess where it is. That lets a malicious user on the same machine read, change, or trick the program into using files it should not.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.