プラットフォーム
python
コンポーネント
tarfile
修正版
3.10.18
3.11.13
3.12.11
3.13.4
3.14.0b3
CVE-2025-4138は、Pythonのtarfileモジュールの抽出フィルターにおける脆弱性です。この脆弱性は、攻撃者がシンボリックリンクを悪用し、展開先ディレクトリ外のファイルを上書きすることを可能にします。影響を受けるバージョンはPython 3.10.0から3.14.0b3です。Python 3.14.0b3以降では、filterパラメータのデフォルト値が変更され、この問題が修正されています。
この脆弱性を悪用されると、攻撃者はtarアーカイブを展開する際に、シンボリックリンクを介して展開先ディレクトリ外の任意のファイルにアクセスし、上書きすることが可能になります。これにより、システムファイルが改ざんされたり、機密情報が漏洩したりする可能性があります。特に、tarアーカイブの信頼性を検証せずに展開する場合、この脆弱性が悪用されるリスクが高まります。攻撃者は、この脆弱性を利用して、システム全体の制御を奪取する可能性も考えられます。
この脆弱性は、Pythonのtarfileモジュールの抽出フィルターの処理に起因します。現時点では、この脆弱性を悪用した具体的な攻撃事例は報告されていませんが、公開されている情報に基づき、攻撃者がこの脆弱性を悪用する可能性は否定できません。CISA KEVカタログへの登録状況は確認されていません。この脆弱性に関する詳細な情報は、NVD(National Vulnerability Database)で確認できます。
Systems using Python 3.10.0 through 3.14.0b3 that process untrusted tar archives are at risk. This includes web applications, automation scripts, and any system that relies on the tarfile module to extract archives from external sources. Shared hosting environments where multiple users can upload files are particularly vulnerable.
• python / server:
find / -name '*tar.gz' -o -name '*tar.bz2' -o -name '*tar'• python / supply-chain:
import os
import tarfile
def check_tarfile_extraction(filepath, destination):
try:
with tarfile.open(filepath, 'r') as tar:
tar.extractall(path=destination, filter='data') # Vulnerable code
return False # No vulnerability detected
except Exception as e:
return True # Vulnerability detected
# Example usage (replace with actual filepaths)
filepath = '/path/to/your/archive.tar.gz'
destination = '/tmp/extraction_test'
if check_tarfile_extraction(filepath, destination):
print(f"Potential vulnerability detected in {filepath}")
else:
print(f"No vulnerability detected in {filepath}")disclosure
エクスプロイト状況
EPSS
0.10% (27% パーセンタイル)
CISA SSVC
CVSS ベクトル
この脆弱性への対応策として、まずPythonのバージョンを3.14.0b3以降にアップデートすることを推奨します。アップデートが困難な場合は、tarfileモジュールのfilterパラメータを使用しない、または信頼できるソースからのtarアーカイブのみを展開するように制限してください。WAFやプロキシサーバーを使用している場合は、tarアーカイブの展開に関連する不正なリクエストを検出・ブロックするルールを実装することも有効です。展開前にtarアーカイブの整合性を検証するスクリプトを導入することも推奨されます。
Actualice la biblioteca CPython a la versión 3.10.18 o superior, 3.11.13 o superior, 3.12.11 o superior, 3.13.4 o superior, o 3.14.0b3 o superior. Evite usar la función `TarFile.extractall()` o `TarFile.extract()` con el parámetro `filter=` configurado en 'data' o 'tar' con archivos tar no confiables.
脆弱性分析と重要アラートをメールでお届けします。
CVE-2025-4138は、Pythonのtarfileモジュールにおける脆弱性で、シンボリックリンクを悪用して展開先ディレクトリ外のファイルを上書きされる可能性があります。
Python 3.10.0から3.14.0b3を使用している場合は影響があります。Python 3.14.0b3以降では修正されています。
Pythonのバージョンを3.14.0b3以降にアップデートすることを推奨します。
現時点では具体的な悪用事例は報告されていませんが、攻撃者が悪用する可能性は否定できません。
Pythonの公式ドキュメント(https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter)で確認できます。
requirements.txt ファイルをアップロードすると、影響の有無を即座にお知らせします。