Skip to content

security: bump nltk >=3.10.0 and fix inisec import blocks - #2290

Merged
kajalj22 merged 3 commits into
mainfrom
security/bump-nltk-cve-jul2026-v2
Aug 3, 2026
Merged

security: bump nltk >=3.10.0 and fix inisec import blocks#2290
kajalj22 merged 3 commits into
mainfrom
security/bump-nltk-cve-jul2026-v2

Conversation

@kajalj22

@kajalj22 kajalj22 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Bump `nltk>=3.10.0` in `iheval` and `rolemrc` (CVE fix), and pre-import `regex` and `defusedxml.ElementTree` in all servers whose import chains reach nltk.

Root cause

`nltk>=3.9` added `NLTKSafeImportFinder` (`nltk/inisec.py`) which blocks any import triggered by nltk if the module's resolved path is inside the process CWD. In CI, server venvs live at `resources_servers//.venv/` — inside the repo root — so legitimate site-packages get blocked. Pre-importing before the nltk chain fires puts packages in `sys.modules`, bypassing the check.

`ifbench` also needs the pre-imports in `conftest.py` so `_ensure_nltk_data()` can download punkt without being silently blocked during `pytest_configure`.

Changes

File Change
`resources_servers/{iheval,rolemrc}/requirements.txt` bump `nltk>=3.10.0`
`resources_servers/{iheval,rolemrc,ifbench,instruction_following,toolsandbox}/app.py` pre-import `regex`, `defusedxml.ElementTree`
`resources_servers/ifbench/tests/conftest.py` same pre-imports before `ensure_ifbench()`

Local test results

Server Result
iheval 88/88 ✓
rolemrc 55/55 ✓
ifbench 15/15 ✓
instruction_following 15/15 ✓
toolsandbox 19/19 ✓

Full test suite run

https://github.com/NVIDIA-NeMo/Gym/actions/runs/30840804435

kajalj22 and others added 3 commits August 3, 2026 13:19
Bump nltk>=3.10.0 in iheval and rolemrc (CVE fix), and pre-import regex
and defusedxml.ElementTree in all servers whose import chains reach nltk.

nltk>=3.9 added NLTKSafeImportFinder (inisec.py) which blocks imports
triggered by nltk if the module path falls inside the process CWD. Server
venvs live inside the repo root in CI, so legitimate site-packages get
blocked. Pre-importing before the nltk chain fires puts packages in
sys.modules and bypasses the check.

ifbench also needs the pre-imports in conftest.py so _ensure_nltk_data()
can download punkt without being silently blocked during pytest_configure.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Signed-off-by: Kajal Jain <kajalj@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@kajalj22 kajalj22 added the r0.5.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. label Aug 3, 2026
@kajalj22
kajalj22 merged commit 0b9192c into main Aug 3, 2026
15 of 16 checks passed
@kajalj22
kajalj22 deleted the security/bump-nltk-cve-jul2026-v2 branch August 3, 2026 18:47
hemildesai added a commit that referenced this pull request Aug 3, 2026
Picks up the nltk bump that unblocks the ifbench/iheval/rolemrc/toolsandbox
and instruction_following server suites (#2290).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Hemil Desai <hemild@nvidia.com>
cmunley1 added a commit that referenced this pull request Aug 3, 2026
## Summary

\`test_sanity_query_input\` was failing in CI because \`review_model\`
is present in \`test_data.json\` (the snapshot) but absent from the
actual server response in some tau2-bench versions.

\`review_model\` was added to \`TextRunConfig\` in tau2-bench v1.0.1
with a default of \`'claude-opus-4-5'\`. Its presence in the serialized
config depends on which tau2-bench commit is installed. The test's
\`_clean()\` function already strips other volatile config fields
(\`max_agent_steps\`, \`turns_remaining_interval\`) — adding
\`review_model\` follows the same pattern and makes the comparison
stable across tau2-bench versions.

## Change

One line added to \`_clean()\` in
\`responses_api_agents/tau2/tests/test_app.py\`:
\`\`\`python
d["config"].pop("review_model", None)
\`\`\`

## Verified

6/6 tau2 tests pass locally.

Failure first surfaced in the full suite run off #2290:
https://github.com/NVIDIA-NeMo/Gym/actions/runs/30840804435

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Christian Munley <cmunley@nvidia.com>
kajalj22 added a commit that referenced this pull request Aug 4, 2026
…` into `r0.5.0` (#2291)

beep boop [🤖]: Hi @kajalj22 👋,

    we've cherry picked #2290 into  for you! 🚀

    Please review and approve this cherry pick by your convenience!

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
Co-authored-by: kajalj22 <kajalj@nvidia.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
…o#2290)

## Summary

Bump \`nltk>=3.10.0\` in \`iheval\` and \`rolemrc\` (CVE fix), and
pre-import \`regex\` and \`defusedxml.ElementTree\` in all servers whose
import chains reach nltk.

## Root cause

\`nltk>=3.9\` added \`NLTKSafeImportFinder\` (\`nltk/inisec.py\`) which
blocks any import triggered by nltk if the module's resolved path is
inside the process CWD. In CI, server venvs live at
\`resources_servers/<name>/.venv/\` — inside the repo root — so
legitimate site-packages get blocked. Pre-importing before the nltk
chain fires puts packages in \`sys.modules\`, bypassing the check.

\`ifbench\` also needs the pre-imports in \`conftest.py\` so
\`_ensure_nltk_data()\` can download punkt without being silently
blocked during \`pytest_configure\`.

## Changes

| File | Change |
|---|---|
| \`resources_servers/{iheval,rolemrc}/requirements.txt\` | bump
\`nltk>=3.10.0\` |
|
\`resources_servers/{iheval,rolemrc,ifbench,instruction_following,toolsandbox}/app.py\`
| pre-import \`regex\`, \`defusedxml.ElementTree\` |
| \`resources_servers/ifbench/tests/conftest.py\` | same pre-imports
before \`ensure_ifbench()\` |

## Local test results

| Server | Result |
|---|---|
| iheval | 88/88 ✓ |
| rolemrc | 55/55 ✓ |
| ifbench | 15/15 ✓ |
| instruction_following | 15/15 ✓ |
| toolsandbox | 19/19 ✓ |

## Full test suite run

https://github.com/NVIDIA-NeMo/Gym/actions/runs/30840804435

---------

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
…#2292)

## Summary

\`test_sanity_query_input\` was failing in CI because \`review_model\`
is present in \`test_data.json\` (the snapshot) but absent from the
actual server response in some tau2-bench versions.

\`review_model\` was added to \`TextRunConfig\` in tau2-bench v1.0.1
with a default of \`'claude-opus-4-5'\`. Its presence in the serialized
config depends on which tau2-bench commit is installed. The test's
\`_clean()\` function already strips other volatile config fields
(\`max_agent_steps\`, \`turns_remaining_interval\`) — adding
\`review_model\` follows the same pattern and makes the comparison
stable across tau2-bench versions.

## Change

One line added to \`_clean()\` in
\`responses_api_agents/tau2/tests/test_app.py\`:
\`\`\`python
d["config"].pop("review_model", None)
\`\`\`

## Verified

6/6 tau2 tests pass locally.

Failure first surfaced in the full suite run off NVIDIA-NeMo#2290:
https://github.com/NVIDIA-NeMo/Gym/actions/runs/30840804435

Signed-off-by: Kajal Jain <kajalj@nvidia.com>
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Christian Munley <cmunley@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r0.5.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants