huggingfaceのDiffusersにおけるコードインジェクションの脆弱性
タイトル huggingfaceのDiffusersにおけるコードインジェクションの脆弱性
概要

Diffusersは事前学習済み拡散モデルのためのライブラリです。バージョン0.38.0以前では、DiffusionPipeline.from_pretrainedのtrust_remote_code回避により、ユーザーがtrust_remote_code=Falseを指定(または省略)していても任意のリモートコードを実行できる脆弱性がありました。この脆弱性には3つの亜種があり、すべて同じ根本原因を共有しています。つまり、trust_remote_codeのチェックはDiffusionPipeline.download()内に実装されていたため、実際の動的モジュールのロード箇所ではなく、download()をバイパスまたは短絡するコードパスがあるとセキュリティチェックも回避されてしまいました。具体例として、DiffusionPipeline.from_pretrained('repoA', custom_pipeline='attacker/repoB', trust_remote_code=False)では、チェックがrepoAのファイルリストに対して評価されたため、repoBのpipeline.pyがロード・実行されました。DiffusionPipeline.from_pretrained('/local/snapshot', custom_pipeline='attacker/repoB', trust_remote_code=False)では、ローカルパスの分岐がdownload()を呼び出さなかったためチェックに到達せず、repoBのリモートコードが実行されました。また、DiffusionPipeline.from_pretrained('/local/snapshot', trust_remote_code=False)でスナップショットにmodel_index.jsonから参照されるカスタムコンポーネントファイル(例:unet/my_unet_model.py)が含まれている場合も同じ根本原因により、ローカルパスがdownload()をスキップし、カスタムコンポーネントのコードが実行されました。本脆弱性はバージョン0.38.0で修正されました。

想定される影響 当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 また、当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
対策

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

公表日 2026年5月14日0:00
登録日 2026年5月20日13:22
最終更新日 2026年5月20日13:22
CVSS3.0 : 重要
スコア 8.8
ベクター CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
影響を受けるシステム
huggingface
Diffusers 0.38.0 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
変更履歴
No 変更内容 変更日
1 [2026年05月20日]
  掲載
2026年5月20日13:22

NVD脆弱性情報
CVE-2026-44513
概要

Diffusers is the a library for pretrained diffusion models. Prior to 0.38.0, a trust_remote_code bypass in DiffusionPipeline.from_pretrained allows arbitrary remote code execution despite the user passing trust_remote_code=False (or omitting it, which is the default). The vulnerability has three variants, all sharing the same root cause — the trust_remote_code gate was implemented inside DiffusionPipeline.download() rather than at the actual dynamic-module load site, so any code path that bypassed or short-circuited download() also bypassed the security check. DiffusionPipeline.from_pretrained('repoA', custom_pipeline='attacker/repoB', trust_remote_code=False) — the gate evaluated against repoA's file list rather than repoB's, so repoB's pipeline.py was loaded and executed. DiffusionPipeline.from_pretrained('/local/snapshot', custom_pipeline='attacker/repoB', trust_remote_code=False) — the local-path branch never invoked download(), so the gate was never reached and remote code from repoB executed. DiffusionPipeline.from_pretrained('/local/snapshot', trust_remote_code=False) where the snapshot contains custom component files (e.g. unet/my_unet_model.py) referenced from model_index.json — same root cause; the local path skipped download() and custom component code executed. This vulnerability is fixed in 0.38.0.

公表日 2026年5月15日2:16
登録日 2026年5月15日4:25
最終更新日 2026年5月19日12:18
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:a:huggingface:diffusers:*:*:*:*:*:python:*:* 0.38.0
関連情報、対策とツール
共通脆弱性一覧