Skip to content

Commit 37de1c4

Browse files
arekay-nvclaude
andcommitted
chore(ci): ignore nltk PYSEC-2026-3740 in pip-audit
nltk 3.10.3 (pulled in by the rouge extra) is flagged by PYSEC-2026-3740 / CVE-2026-81726, a path traversal in model-artifact APIs (TransitionParser, AveragedPerceptron, PerceptronTagger, maxent). No fixed release exists yet (nltk/nltk#3753). This repo only uses sent_tokenize and rouge_score's Porter stemmer, so the vulnerable code is unreachable. Ignore the advisory in CI's pip-audit and document the flag for local runs. Removal is tracked in #520. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 832eaf7 commit 37de1c4

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ jobs:
7272
run: uv sync --frozen --extra dev --extra test --extra performance
7373

7474
- name: Audit dependencies for known vulnerabilities
75-
run: uv run pip-audit
75+
# PYSEC-2026-3740 (CVE-2026-81726): nltk path traversal in model-artifact
76+
# APIs (TransitionParser, AveragedPerceptron, PerceptronTagger, maxent).
77+
# Unreachable here: only sent_tokenize and rouge_score's Porter stemmer
78+
# are used. No fixed nltk release yet.
79+
# TODO: drop the ignore - https://github.com/mlcommons/endpoints/issues/520
80+
run: uv run pip-audit --ignore-vuln PYSEC-2026-3740
7681

7782
bfcl-smoke:
7883
runs-on: ubuntu-latest

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,5 +533,5 @@ Known failure modes when AI tools generate code for this project. Reference thes
533533

534534
### Dependency & Environment
535535

536-
- **Adding new dependencies without justification**: AI may `pip install` or add imports for packages not in `pyproject.toml`. Any new runtime, dev, or test dependency must be justified, added to the correct optional group, and pinned to an exact version (`==`). After adding a dependency, run `pip-audit` (included in `dev` extras) to verify it has no known vulnerabilities. When adding dependencies, use `uv add <package>==<version>` to update both `pyproject.toml` and `uv.lock` atomically, then run `uv run pip-audit` to check for vulnerabilities. Note: `[build-system] requires` is also pinned to exact versions for reproducibility.
536+
- **Adding new dependencies without justification**: AI may `pip install` or add imports for packages not in `pyproject.toml`. Any new runtime, dev, or test dependency must be justified, added to the correct optional group, and pinned to an exact version (`==`). After adding a dependency, run `pip-audit` (included in `dev` extras) to verify it has no known vulnerabilities. When adding dependencies, use `uv add <package>==<version>` to update both `pyproject.toml` and `uv.lock` atomically, then run `uv run pip-audit --ignore-vuln PYSEC-2026-3740` to check for vulnerabilities (the ignored `nltk` advisory has no fixed release and its affected APIs are unused; tracked in https://github.com/mlcommons/endpoints/issues/520). Note: `[build-system] requires` is also pinned to exact versions for reproducibility.
537537
- **Using `requests`/`aiohttp` for HTTP**: This project has its own HTTP client (`endpoint_client/http.py`) using `httptools`. AI defaults to `requests` or `aiohttp` — these should not appear in production code (test dependencies are fine).

‎docs/DEVELOPMENT.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,11 @@ Use `uv add <package>==<version>` to update both `pyproject.toml` and `uv.lock`
226226
After adding a dependency, run `pip-audit` to verify it has no known vulnerabilities:
227227

228228
```bash
229-
uv run pip-audit
229+
uv run pip-audit --ignore-vuln PYSEC-2026-3740
230230
```
231231

232+
`PYSEC-2026-3740` is an `nltk` advisory with no fixed release whose affected APIs this repo doesn't use; CI ignores it too. Drop the flag once [#520](https://github.com/mlcommons/endpoints/issues/520) is resolved.
233+
232234
## Performance Considerations
233235

234236
Code in `load_generator/`, `endpoint_client/worker.py`, and `async_utils/transport/` is latency-critical. In these paths:

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ rouge = [
170170
# NOTE: not self-contained at runtime - nltk needs the punkt/punkt_tab
171171
# corpora and evaluate.load("rouge") fetches its metric script from the HF
172172
# Hub, so an offline image must prefetch both.
173+
# nltk advisory PYSEC-2026-3740 has no fixed release and is ignored in CI's
174+
# pip-audit (affected APIs unused); tracked in
175+
# https://github.com/mlcommons/endpoints/issues/520
173176
"nltk==3.10.3",
174177
"evaluate==0.4.6",
175178
"rouge-score==0.1.2",

0 commit comments

Comments
 (0)