CVE-2024-5182は、localaiのモデル削除機能におけるパス・トラバーサル脆弱性です。攻撃者はmodelパラメータを操作することで、本来アクセスできないファイルシステム上のファイルを削除できてしまいます。この脆弱性は、localaiのバージョン2.14.0以前に影響を与え、バージョン2.16.0で修正されました。
この脆弱性を悪用されると、攻撃者はmodelパラメータに巧妙に細工したリクエストを送信することで、ファイルシステムのディレクトリ構造を自由に移動し、意図しないファイルを削除することが可能になります。特に、機密情報を含む設定ファイルやデータベースファイルなどが削除されるリスクがあり、システムの可用性や機密性に深刻な影響を及ぼす可能性があります。攻撃者は、この脆弱性を利用して、localaiの実行環境全体を制御しようと試みる可能性も否定できません。
この脆弱性は、2024年6月19日に公開されました。現時点では、公的なPoC(Proof of Concept)は確認されていませんが、パス・トラバーサル脆弱性は一般的に悪用が容易であるため、早期に悪用される可能性があります。CISAのKEV(Known Exploited Vulnerabilities)カタログへの登録状況は不明です。
Organizations deploying localai in production environments, particularly those using older versions (≤2.16.0), are at risk. Shared hosting environments where multiple users share the same localai instance are also vulnerable, as an attacker could potentially exploit the vulnerability to delete files belonging to other users. Users relying on localai for critical data processing or storage should prioritize patching.
• docker: Inspect running containers for localai versions prior to 2.16.0 using docker ps and docker exec -it <container_id> localai --version.
• file system: Monitor file system activity for unexpected file deletions, particularly in directories containing sensitive data. Use tools like inotifywait (Linux) or file integrity monitoring solutions.
• network: Monitor network traffic for suspicious requests targeting the model deletion endpoint with unusual or manipulated parameters. Use tools like Wireshark or tcpdump.
• logs: Examine localai application logs for error messages or warnings related to file access or deletion attempts.
disclosure
エクスプロイト状況
EPSS
2.49% (85% パーセンタイル)
CISA SSVC
CVSS ベクトル
まず、localaiをバージョン2.16.0以降にアップデートすることを強く推奨します。アップデートが困難な場合は、modelパラメータに対する入力検証を強化するカスタムのセキュリティルールを実装することを検討してください。WAF(Web Application Firewall)を使用している場合は、パス・トラバーサル攻撃を検知・防御するためのルールを設定することも有効です。また、ファイルシステムのアクセス権限を適切に設定し、攻撃者が意図しないファイルにアクセスできないように制限することも重要です。アップデート後、modelパラメータを介してファイル削除を試み、脆弱性が解消されていることを確認してください。
Actualice a la versión 2.16.0 o posterior de mudler/localai. Esta versión corrige la vulnerabilidad de path traversal. La actualización se puede realizar descargando la nueva imagen de Docker o actualizando el código fuente y reconstruyendo la aplicación.
脆弱性分析と重要アラートをメールでお届けします。
CVE-2024-5182は、localaiのモデル削除機能におけるパス・トラバーサル脆弱性で、攻撃者がmodelパラメータを操作して意図しないファイルを削除できる可能性があります。
localaiのバージョンが2.16.0以前を使用している場合は、影響を受けます。バージョン2.16.0以降にアップデートしてください。
localaiをバージョン2.16.0以降にアップデートしてください。アップデートが困難な場合は、入力検証の強化を検討してください。
現時点では公的なPoCは確認されていませんが、パス・トラバーサル脆弱性は悪用が容易であるため、早期に悪用される可能性があります。
localaiの公式アドバイザリは、プロジェクトのGitHubリポジトリまたは公式ウェブサイトで確認してください。
Dockerfile ファイルをアップロードすると、影響の有無を即座にお知らせします。