Skip to content

Raise puzzletron Hydra minimum to hydra-core~=1.3.4 (CVE-2026-68508) - #2341

Merged
kevalmorabia97 merged 1 commit into
mainfrom
fix/bump-hydra-core-cve-2026-68508
Sep 8, 2026
Merged

Raise puzzletron Hydra minimum to hydra-core~=1.3.4 (CVE-2026-68508)#2341
kevalmorabia97 merged 1 commit into
mainfrom
fix/bump-hydra-core-cve-2026-68508

Conversation

@kevalmorabia97

@kevalmorabia97 kevalmorabia97 commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Type of change: Bug fix

Raises the puzzletron extra's Hydra minimum from ==1.3.2 to ~=1.3.4, picking up the hydra.utils.instantiate() target blocking added in Hydra 1.3.4 for CVE-2026-68508.

Are we affected? Not exploitable in practice, but the vulnerable code was in the dependency tree. ModelOpt calls hydra.utils.instantiate() in four places, all inside modelopt/torch/puzzletron:

  • modelopt/torch/puzzletron/entrypoint.py:58
  • modelopt/torch/puzzletron/scoring.py:82
  • modelopt/torch/puzzletron/puzzletron_nas_plugin.py:126 and :227

In every case the config is composed by initialize_hydra_config_for_dir() from a local directory path the caller supplies, and the only overrides ModelOpt injects are the fixed puzzle_dir and dataset_path. Nothing reads a Hydra config out of model metadata, a checkpoint, or any downloaded artifact, which is the model-loader scenario the advisory calls out. Every _target_ in the shipped examples/puzzletron/configs/ resolves to a ModelOpt descriptor or pruning mixin class.

Two things worth recording for future readers:

  • modelopt/torch/puzzletron/scoring.py is decorated with @hydra.main, so running it directly accepts arbitrary CLI overrides such as +x._target_=os.system. That crosses no privilege boundary since the operator can already run Python.
  • modelopt/torch/puzzletron/tools/hydra_utils.py:102 registers a ${get_object:...} OmegaConf resolver that imports arbitrary dotted paths during OmegaConf.resolve. The 1.3.4 fix does not cover that resolver, so it remains an equivalent gadget under the same assumption: a Hydra config directory is trusted input, equivalent to executable code.

Why ~=1.3.4 and not ~=1.3.0: the compatible-release form ~=1.3.0 would still admit 1.3.0 through 1.3.3, which are the vulnerable releases. ~=1.3.4 means >=1.3.4,<1.4.0, so it enforces the fix while keeping us off the 1.4 line.

uv.lock is intentionally not regenerated here; it still pins hydra-core==1.3.2. The weekly bump_uv_lock.yml job will pick up the new constraint.

Usage

# No user-facing API change. Install the puzzletron extra as usual:
# pip install "nvidia-modelopt[puzzletron]"

Testing

Verified in a clean throwaway venv, not in the repo environment:

  • pip install "hydra-core~=1.3.4" resolves to 1.3.6, the current stable release.
  • Confirmed 1.3.6 ships hydra/_internal/target_policy.py, absent in 1.3.2, and that 1.3.2's _resolve_target has no target checks.
  • Confirmed the new policy is a blocklist of specific dangerous callables, not a deny-by-default allowlist, so third-party targets such as our modelopt.torch.puzzletron.* descriptors are unaffected. This was the main compatibility risk of the bump.
  • Smoke-tested instantiate() on 1.3.6: benign targets (collections.OrderedDict, pathlib.Path) instantiate normally, while builtins.eval raises InstantiationException.
  • Confirmed no _target_ value in examples/puzzletron/configs/ appears in DEFAULT_BLOCKLISTED_MODULES or UNCONTROLLED_EXECUTION_TARGETS.

I did not run the puzzletron pipeline end to end against 1.3.6; it needs multi-GPU and a model checkpoint.

Before your PR is "Ready for review"

  • Is this change backward compatible?: ✅
  • If you copied code from any other sources or added a new PIP dependency, did you follow guidance in CONTRIBUTING.md: N/A
  • Did you write any new necessary tests?: N/A
  • Did you update Changelog?: ❌ — dependency floor bump with no user-facing behavior change.
  • Did you get Claude approval on this PR?: N/A

Additional Information

Advisory: CVE-2026-68508, fixed in hydra-core 1.3.4. Latest stable is 1.3.6.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated an optional dependency to a compatible Hydra Core 1.3.x release range.

Hydra < 1.3.4 resolves and calls arbitrary Python objects named by a
config's _target_ in hydra.utils.instantiate(). 1.3.4 adds target
blocking for dangerous callables, with a HYDRA_INSTANTIATE_ALLOWLIST_OVERRIDE
escape hatch.

ModelOpt calls instantiate() only in modelopt/torch/puzzletron, on configs
composed from a local directory the caller supplies, so no ModelOpt
workflow was exploitable. The bump removes the vulnerable code from the
dependency tree.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97
kevalmorabia97 requested a review from a team as a code owner September 5, 2026 12:48
@kevalmorabia97 kevalmorabia97 added the cherry-pick-0.47.0 Upcoming release label Sep 5, 2026
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2a9e8f28-9bd7-4111-b89b-e5444747177d

📥 Commits

Reviewing files that changed from the base of the PR and between a7f339e and 3439abe.

📒 Files selected for processing (1)
  • pyproject.toml

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The puzzletron optional dependency now accepts compatible hydra-core 1.3 releases starting at version 1.3.4.

Changes

Dependency declaration

Layer / File(s) Summary
Update puzzletron requirement
pyproject.toml
The puzzletron extra changes hydra-core from an exact 1.3.2 pin to ~=1.3.4.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 3439a

Puzzletron installations will resolve Hydra 1.3.4 or later within the 1.3 series, replacing the prior vulnerable pin without changing the public API. No merge-blocking risk remains.

Suggested reviewers: shengliangxu, chenhanyu

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: raising the puzzletron Hydra dependency to hydra-core~=1.3.4 to address CVE-2026-68508.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Anti-Patterns ✅ Passed PASS. The pull request changes only pyproject.toml: it replaces the existing hydra-core==1.3.2 constraint with hydra-core~=1.3.4. No modelopt or examples Python files changed, so the listed …
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bump-hydra-core-cve-2026-68508

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.81%. Comparing base (a7f339e) to head (3439abe).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2341      +/-   ##
==========================================
- Coverage   79.31%   78.81%   -0.51%     
==========================================
  Files         527      527              
  Lines       61487    61487              
==========================================
- Hits        48770    48458     -312     
- Misses      12717    13029     +312     
Flag Coverage Δ
examples-diffusers 20.58% <ø> (ø)
examples-gpt-oss 13.17% <ø> (ø)
examples-hf_ptq 21.31% <ø> (-0.04%) ⬇️
examples-llm_distill 13.24% <ø> (-0.01%) ⬇️
examples-llm_eval 16.96% <ø> (ø)
examples-llm_qat 17.44% <ø> (-0.01%) ⬇️
examples-llm_sparsity 15.78% <ø> (ø)
examples-megatron_bridge 26.25% <ø> (-0.11%) ⬇️
examples-specdec_bench 12.92% <ø> (ø)
examples-speculative_decoding 17.38% <ø> (-0.07%) ⬇️
examples-torch_onnx 21.67% <ø> (ø)
examples-torch_trt 14.96% <ø> (ø)
gpu 58.72% <ø> (-0.70%) ⬇️
regression 14.81% <ø> (+0.07%) ⬆️
unit 55.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevalmorabia97
kevalmorabia97 merged commit 5cae394 into main Sep 8, 2026
55 checks passed
@kevalmorabia97
kevalmorabia97 deleted the fix/bump-hydra-core-cve-2026-68508 branch September 8, 2026 10:49
@kevalmorabia97 kevalmorabia97 added the cherry-pick-done Added by bot once PR is cherry-picked to the release branch label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-08 10:49 UTC

kevalmorabia97 added a commit that referenced this pull request Sep 8, 2026
…2341)

### What does this PR do?

Type of change: Bug fix

Raises the `puzzletron` extra's Hydra minimum from `==1.3.2` to
`~=1.3.4`, picking up the `hydra.utils.instantiate()` target blocking
added in Hydra 1.3.4 for CVE-2026-68508.

**Are we affected?** Not exploitable in practice, but the vulnerable
code was in the dependency tree. ModelOpt calls
`hydra.utils.instantiate()` in four places, all inside
`modelopt/torch/puzzletron`:

- `modelopt/torch/puzzletron/entrypoint.py:58`
- `modelopt/torch/puzzletron/scoring.py:82`
- `modelopt/torch/puzzletron/puzzletron_nas_plugin.py:126` and `:227`

In every case the config is composed by
`initialize_hydra_config_for_dir()` from a local directory path the
caller supplies, and the only overrides ModelOpt injects are the fixed
`puzzle_dir` and `dataset_path`. Nothing reads a Hydra config out of
model metadata, a checkpoint, or any downloaded artifact, which is the
model-loader scenario the advisory calls out. Every `_target_` in the
shipped `examples/puzzletron/configs/` resolves to a ModelOpt descriptor
or pruning mixin class.

Two things worth recording for future readers:

- `modelopt/torch/puzzletron/scoring.py` is decorated with
`@hydra.main`, so running it directly accepts arbitrary CLI overrides
such as `+x._target_=os.system`. That crosses no privilege boundary
since the operator can already run Python.
- `modelopt/torch/puzzletron/tools/hydra_utils.py:102` registers a
`${get_object:...}` OmegaConf resolver that imports arbitrary dotted
paths during `OmegaConf.resolve`. The 1.3.4 fix does not cover that
resolver, so it remains an equivalent gadget under the same assumption:
a Hydra config directory is trusted input, equivalent to executable
code.

**Why `~=1.3.4` and not `~=1.3.0`:** the compatible-release form
`~=1.3.0` would still admit 1.3.0 through 1.3.3, which are the
vulnerable releases. `~=1.3.4` means `>=1.3.4,<1.4.0`, so it enforces
the fix while keeping us off the 1.4 line.

`uv.lock` is intentionally not regenerated here; it still pins
`hydra-core==1.3.2`. The weekly `bump_uv_lock.yml` job will pick up the
new constraint.

### Usage

```python
# No user-facing API change. Install the puzzletron extra as usual:
# pip install "nvidia-modelopt[puzzletron]"
```

### Testing

Verified in a clean throwaway venv, not in the repo environment:

- `pip install "hydra-core~=1.3.4"` resolves to 1.3.6, the current
stable release.
- Confirmed 1.3.6 ships `hydra/_internal/target_policy.py`, absent in
1.3.2, and that 1.3.2's `_resolve_target` has no target checks.
- Confirmed the new policy is a **blocklist** of specific dangerous
callables, not a deny-by-default allowlist, so third-party targets such
as our `modelopt.torch.puzzletron.*` descriptors are unaffected. This
was the main compatibility risk of the bump.
- Smoke-tested `instantiate()` on 1.3.6: benign targets
(`collections.OrderedDict`, `pathlib.Path`) instantiate normally, while
`builtins.eval` raises `InstantiationException`.
- Confirmed no `_target_` value in `examples/puzzletron/configs/`
appears in `DEFAULT_BLOCKLISTED_MODULES` or
`UNCONTROLLED_EXECUTION_TARGETS`.

I did not run the puzzletron pipeline end to end against 1.3.6; it needs
multi-GPU and a model checkpoint.

### Before your PR is "*Ready for review*"

- Is this change backward compatible?: ✅
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
❌ — dependency floor bump with no user-facing behavior change.
- Did you get Claude approval on this PR?: N/A

### Additional Information

Advisory: CVE-2026-68508, fixed in hydra-core 1.3.4. Latest stable is
1.3.6.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated an optional dependency to a compatible Hydra Core 1.3.x
release range.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-0.47.0 Upcoming release cherry-pick-done Added by bot once PR is cherry-picked to the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant