vllm - ✅(Solved) Fix CVE-2026-22807 fix not on releases/v0.12.0 — try_get_class_from_dynamic_module unguarded [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#41275Fetched 2026-04-30 06:19:10
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #41311: [CVE Backport] Handle trust_remote_code for transformers backend (releases/v0.12.0)

Description (problem / solution / changelog)

Summary

Backport of #32194 (commit 78d13ea9, "[Model] Handle trust_remote_code for transformers backend") to releases/v0.12.0. The upstream change closes CVE-2026-22807: the transformers-backend custom-code path could load remote *.py definitions without honoring the --trust-remote-code gate.

Tracking issue: #41275 (vulgraph reported the same gap on every release branch in support — #41157 v0.11.0, #41271 v0.11.1, #41273 v0.11.2, #41275 v0.12.0). This PR addresses v0.12.0; if accepted I'll send the same patch to the other three.

What changes

Verbatim cherry-pick of 78d13ea9. Two files, +14/-1:

  • vllm/transformers_utils/dynamic_module.py — adds a trust_remote_code: bool parameter to try_get_class_from_dynamic_module and calls transformers.dynamic_module_utils.resolve_trust_remote_code(...) before forwarding to get_class_from_dynamic_module. Imports resolve_trust_remote_code.
  • vllm/model_executor/models/registry.py — both call sites in _try_resolve_transformers (the warn_on_fail=False and warn_on_fail=True arms) now thread trust_remote_code=model_config.trust_remote_code through.

resolve_trust_remote_code is a long-standing helper in transformers.dynamic_module_utils; this branch already pins transformers >= 4.56.0, < 5, so the import is safe.

Why it isn't a duplicate

gh pr list --repo vllm-project/vllm --base releases/v0.12.0 --state open and searches for 32194 in:body and 78d13ea9 in:body (state: all) returned no existing PR against any release branch. The reporter offered the cherry-pick on each issue but hasn't sent one yet.

Tests run

  • git cherry-pick -x 78d13ea9 — applied cleanly, no conflicts.
  • ruff check on both touched files — clean.
  • ruff format --check on both touched files — already formatted.
  • mypy --python-version 3.10 --ignore-missing-imports vllm/transformers_utils/dynamic_module.pySuccess: no issues found in 1 source file.
  • typos on both touched files — clean.
  • python -c "import ast; ast.parse(...)" on both files — OK.
  • grep -rn try_get_class_from_dynamic_module across the branch — only two callers exist (both in registry.py); both pass the new kwarg.

The upstream commit shipped without a regression test and there's no existing test that exercises try_get_class_from_dynamic_module, so I haven't added one here either — the goal of this PR is byte-identical behavior with main.

AI assistance disclosure

Claude (Anthropic) assisted with: locating the upstream commit, reading the four CVE issues, running the duplicate-PR checks, executing the cherry-pick and the lint/mypy/typos commands, and drafting this PR body. Every changed line is the upstream maintainer's; I (Demian Havdun) reviewed the diff and signed off as committer per DCO. Co-author trailer added per AGENTS.md.

Changed files

  • vllm/model_executor/models/registry.py (modified, +2/-0)
  • vllm/transformers_utils/dynamic_module.py (modified, +12/-1)

Code Example

resolve_trust_remote_code(
    trust_remote_code,
    pretrained_model_name_or_path,
    has_local_code=False,
    has_remote_code=True,
)
RAW_BUFFERClick to expand / collapse

Upstream commit 78d13ea9 — the CVE-2026-22807 fix — adds:

resolve_trust_remote_code(
    trust_remote_code,
    pretrained_model_name_or_path,
    has_local_code=False,
    has_remote_code=True,
)

into vllm/transformers_utils/dynamic_module.py::try_get_class_from_dynamic_module(), plus threads trust_remote_code=model_config.trust_remote_code into both get_class_from_dynamic_module callers inside _try_resolve_transformers() (vllm/model_executor/models/registry.py). On releases/v0.12.0 neither change is in: the helper has no such parameter and the registry call sites pass through unchanged. Net result — the transformers-backend custom-code path is loadable without honoring the --trust-remote-code gate. Glad to send a cherry-pick if releases/v0.12.0 is still receiving security fixes.

extent analysis

TL;DR

The issue can be fixed by backporting the CVE-2026-22807 fix from the upstream commit to the releases/v0.12.0 branch.

Guidance

  • The missing trust_remote_code parameter in resolve_trust_remote_code and get_class_from_dynamic_module calls suggests a version mismatch or incomplete backport.
  • To verify the issue, check if the --trust-remote-code flag is being honored when loading custom code in the transformers-backend path on releases/v0.12.0.
  • Cherry-picking the upstream commit 78d13ea9 into releases/v0.12.0 may resolve the issue, as it adds the necessary trust_remote_code parameter and threads it through the relevant function calls.
  • Before applying the fix, ensure that releases/v0.12.0 is still receiving security fixes and that the cherry-pick does not introduce any compatibility issues.

Notes

The provided information implies that the issue is specific to the releases/v0.12.0 branch and may not affect other versions.

Recommendation

Apply workaround: Cherry-pick the upstream commit 78d13ea9 into releases/v0.12.0 to ensure the --trust-remote-code flag is honored when loading custom code in the transformers-backend path.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING