製品・ソフトウェアに関する情報
huggingfaceのDiffusersにおけるコードインジェクションの脆弱性
Title huggingfaceのDiffusersにおけるコードインジェクションの脆弱性
Summary

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で修正されました。

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

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

Publication Date May 14, 2026, midnight
Registration Date May 20, 2026, 1:22 p.m.
Last Update May 20, 2026, 1:22 p.m.
CVSS3.0 : 重要
Score 8.8
Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Affected System
huggingface
Diffusers 0.38.0 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
Change Log
No Changed Details Date of change
1 [2026年05月20日]
  掲載
May 20, 2026, 1:22 p.m.

NVD Vulnerability Information
CVE-2026-44513
Summary

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.

Publication Date May 15, 2026, 2:16 a.m.
Registration Date May 15, 2026, 4:25 a.m.
Last Update May 19, 2026, 12:18 p.m.
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:a:huggingface:diffusers:*:*:*:*:*:python:*:* 0.38.0
Related information, measures and tools
Common Vulnerabilities List