Repository navigation
Description
Hi, I use diffusers in my own video work and I ran an independent security review of the repo as a follower of the project, just sharing what I found in case it helps. Please forgive me if any of the wording below comes across the wrong way — I mean no offence, and I am happy to be corrected where I have got something wrong.
Dev report — huggingface/diffusers (B5-RESUME, chain 3 Dec 2026)
Pin judged: 12d5c7a53a7c7673c07f834d7f4149973fe94455 (live HEAD at filing time, 3 Dec 2026). The chain scanned facc812ea3c686f9a3d5d0503a4650d3ed0ff432 (live HEAD at chain time); the three commits since then (ffddb60, 7978fbb, 12d5c7a — all cache-related) touch no dependency file, and the dependency files are identical at both pins, so the findings below stand unchanged at this pin. Pre-post re-check 3 Dec 2026 ~13:31–13:36 IST: live HEAD 12d5c7a, no dependency floor bumped since the scan, no duplicate issue (exact "security review" 0 results, "GHSA-4j2p" 0 results, author:ujjwalD16 0 results).
Licence: Apache-2.0 (LICENSE read firsthand). Verdict: PASS conditional.
Union: 1538 keys, 0 REAL (all FP); OSV distinct: 16 pairs / 226 instances / 226 IDs.
Governing fixes proven REAL 0 by re-query at the fixed versions (govfix round 1: 15 packages; accelerate 1.16.0 separately).
1. OSV — floor dependencies (setup.py floors + the many examples/**/requirements.txt pins, 75 packages queried; the library itself has no lockfile)
Where the queried versions come from: the extractor takes the minimum version from each >= floor / == pin across setup.py and the examples requirements files — e.g. accelerate>=0.16.0 and transformers>=4.25.1 are the floors in examples/consistency_distillation/requirements.txt, while torch==2.7.0, aiohttp==3.12.14, urllib3==2.5.0, jinja2==3.1.4, starlette==0.41.0 and requests==2.32.3 are the exact pins in examples/server/requirements.txt (a uv-compiled lockfile for the example server, not for the library itself). The library's own setup.py floors are also below the governing fixes (torch>=2.6, transformers>=4.41.2, accelerate>=0.31.0), so the finding stands in setup.py terms too. Related, not a duplicate: stale Dependabot PR #11234 (jinja2 3.1.4 -> 3.1.6 in /examples/server, Apr 2025) covers one package; this review covers all 16.
| Package | Queried version | Advisories | Governing fix | Re-query at fix |
|---|---|---|---|---|
PyPI accelerate |
0.16.0 | 2 | 1.16.0 | REAL 0 |
PyPI aiohttp |
3.12.14 | 98 | 3.14.4 | REAL 0 |
PyPI anyio |
4.6.2.post1 | 4 | 4.14.2 | REAL 0 |
PyPI certifi |
2024.8.30 | 2 | 2026.10.18 | REAL 0 |
PyPI datasets |
2.19.1 | 2 | 5.0.1 | REAL 0 |
PyPI filelock |
3.16.1 | 6 | 4.2.1 | REAL 0 |
PyPI fsspec |
2024.10.0 | 2 | 2026.6.0 | REAL 0 |
PyPI h11 |
0.14.0 | 2 | 0.16.0 | REAL 0 |
PyPI idna |
3.10 | 2 | 3.15 | REAL 0 |
PyPI jinja2 |
3.1.4 | 6 | 3.1.6 | REAL 0 |
PyPI requests |
2.32.3 | 4 | 2.33.0 | REAL 0 |
PyPI sentencepiece |
0.2.0 | 2 | 0.2.1 | REAL 0 |
PyPI starlette |
0.41.0 | 14 | 1.3.1 | REAL 0 |
PyPI torch |
2.7.0 | 16 | 2.13.0 | REAL 0 |
PyPI transformers |
4.25.1 | 52 | 5.10.0 | REAL 0 |
PyPI urllib3 |
2.5.0 | 12 | 2.8.0 | REAL 0 |
Total: 16 packages, 226 advisories, distinct IDs 226.
The library itself has no lockfile, so the floor is the full OSV picture (floor_only = all 16 pairs).
Fixes (governing = max over the whole upgrade path, every fixed version verified to exist on PyPI before the re-query):
accelerate0.16.0 -> 1.16.0 (2 advisories)aiohttp3.12.14 -> 3.14.4 (98 advisories)anyio4.6.2.post1 -> 4.14.2 (4 advisories)certifi2024.8.30 -> 2026.10.18 (2 advisories)datasets2.19.1 -> 5.0.1 (2 advisories)filelock3.16.1 -> 4.2.1 (6 advisories)fsspec2024.10.0 -> 2026.6.0 (2 advisories)h110.14.0 -> 0.16.0 (2 advisories)idna3.10 -> 3.15 (2 advisories)jinja23.1.4 -> 3.1.6 (6 advisories)requests2.32.3 -> 2.33.0 (4 advisories)sentencepiece0.2.0 -> 0.2.1 (2 advisories)starlette0.41.0 -> 1.3.1 (14 advisories)torch2.7.0 -> 2.13.0 (16 advisories)transformers4.25.1 -> 5.10.0 (52 advisories)urllib32.5.0 -> 2.8.0 (12 advisories)
Notes on the no-fix advisories (all resolved by the governing fix, proven by the re-query):
torch@2.7.0: PYSEC-2026-139 has nofixedevent; resolved at torch 2.13.0 (re-query REAL 0).transformers@4.25.1: 9 PYSEC IDs (PYSEC-2025-211..218, PYSEC-2026-2290) have nofixedevent; resolved at transformers 5.10.0 (re-query REAL 0).accelerate@0.16.0: GHSA-4j2p-28q2-5m79 + PYSEC-2026-3804 (same path-traversal in sharded-checkpoint loading,last_affected: 1.14.0, no fixed version); resolved by upgrading past 1.14.0 — latest accelerate 1.16.0 (exists on PyPI) re-queried REAL 0.
2. Code — no REAL findings (union 1,538 keys, all FP)
The split re-scan (11 chunks + 8 remainder chunks + a direct utils scan) produced a 1,538-key union. Every key was adjudicated firsthand; none is a REAL cross-boundary finding. Cloudflare security-audit guidance-mode: 0 confirmed findings.
By rule (all FP): SC1 x455 (unpinned floors, mostly in examples requirements — see condition 2), AST7 x369 (getattr on fixed enums / benign patterns, LOW), AST10 x138 (torch.load on operator-supplied checkpoint paths in convert_from_ckpt.py + examples/scripts — hardening note), P9 x88 / P7 x30 / P2 x17 / P6 x2 / P1 x1 (prompt rules on static text: docs, PR template, description strings, notebooks, and the claude_review workflow's own anti-injection instructions), SC4 x63 (the scanner's own OSV fallback notice, superseded by direct OSV runs), AE4 x52 (empty-pattern scanner artifact at line 1 of source files), MP2 x46 / AS3 x28 / E1 x23 / OH3 x14 (docstrings, tensor ops, URL constants, docs), PE5 x31 / PE3 x13 (CI workflow run: steps + docs install commands, fixed, operator's own CI), YR1 x27 / YR4 x6 (YARA matches on doc text / docstrings), AR2 x17 / RA1 x13 (docstrings, log messages, docs, tests), TM1 x24 / TM2 x10 (Markdown docs — AGENTS.md / CLAUDE.md / .ai/AGENTS.md, non-executable, structural FP; CI workflows/actions, fixed commands; Dockerfiles, canonical RUN; example scripts/notebooks, operator-run), TM3 x2 (short-lived CI GitHub App token in an HTTPS remote URL for pushing style fixes to a PR fork — no verify=False, no plaintext exposure), TT3 x5 CRITICAL (operator's own Slack webhook URL, from env, used as the POST destination in CI notification scripts x4; operator's own GitHub token as Bearer to GitHub's own GraphQL API x1 — same-principal, vendor's own endpoints), AST2 x8 (eval(norm_layer) on an operator-supplied class-name string in a research example — no cross-boundary input), AST5 x1 (os.system f-string ffmpeg call in a community example, operator-supplied directory path), E2 x1 (the library's own USE_TF/USE_TORCH feature flags read from the operator's own environment), E4 x5 (quoted academic paper abstracts in API docs), MP3 x4 (the library's own documented MagCache/TaylorSeer acceleration hooks, operator-opt-in; the claude_review workflow's anti-injection instructions; a notebook), E5 x1, RP1 x1, SC2 x4, SC10 x1, EA2 x3, EA3 x8, EA4 x2, PE2 x4, AST4 x11 (docs, tests, benign code).
3. Conditions
- Bump the 16 packages to the governing fix versions above (proven REAL 0).
- Pin the library's dependencies and add a lockfile (the library itself has no lockfile — examples/server/requirements.txt is a uv-compiled lockfile for the example server only; the floor carries
>=floors and the examples carry 450 unpinned SC1 entries). - Hardening notes (not verdict blockers): (a) use
weights_only=True(or safetensors) for thetorch.loadcalls insrc/diffusers/pipelines/stable_diffusion/convert_from_ckpt.pyand in example/script checkpoint loaders when loading checkpoints from untrusted sources; (b) convert theos.systemf-string ffmpeg call inexamples/community/adaptive_mask_inpainting.py:192to a list-form subprocess call if it is ever used with untrusted paths; (c) replaceeval(norm_layer)inexamples/research_projects/anytext/ocr_recog/RecSVTR.pywith a fixed class mapping if the value ever comes from untrusted input. - Coverage note: 2,702/3,077 files (87.8%) fully inspected by all analyzers. The remaining ~375 files (mainly
src/diffusers/pipelines/+examples/) were inspected by 24 of 27 analyzers; thestatic_patterns_tool_misuseanalyzer did not complete on them within the scanner's 1080 s per-scan budget (its per-file cost on these files exceeds the budget even in 75-file chunks). Where tool_misuse did complete in the remainder scans it added only 3 new union keys, so the residual gap is small; it is recorded here, not hidden.
4. Scan method (for the record)
Full-repo scan 1 returned 0.0% coverage (599 issues, runtime limit), so the repo was split into 11 chunks (3,034 files, real copies, repo-relative layout) + a direct scan of src/diffusers/utils (42 files, 100%) + 8 remainder chunks (577 partial files, 75 per chunk). The union merges all 20 scans by (rule, file, line) with dedupe; chunk + remainder paths are already repo-relative; the utils direct scan is prefixed src/diffusers/utils/. The scanner's per-scan time budget is MAX_WORKFLOW_SECONDS (default 1080 s, env SKILLSPECTOR_MAX_WORKFLOW_SECONDS); the outer timeout 1800 caps any scan at 30 min.
Activity