Skip to content

build(deps): bump pyasn1, pypdf and minimatch to clear osv-scan - #49362

Merged
mateo-berri merged 2 commits into
mainfrom
dependabot/uv/pyasn1-0.6.5
Oct 31, 2026
Merged

mateo-berri merged 2 commits into
mainfrom
dependabot/uv/pyasn1-0.6.5

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

osv-scan has been red on every PR since Oct 30 23:15 UTC because new advisories came out for three packages in our lockfiles. This bumps pyasn1 to 0.6.5 and pypdf to 6.21.4 in uv.lock, which the proxy Docker image installs from, and moves the dev-only minimatch in the dashboard and the VS Code extension to 11.0.2. That clears all 13 findings. It builds on dependabot's pyasn1 commit here, so one PR covers all three packages

pypdf 6.21.4 is still inside our 3-day uv cooldown until Oct 31 17:01 UTC, so pyproject.toml carries a dated cutoff for it with a TODO, the same way the brotli entry does. That entry can go once the window passes

Details

TLDR

Problem this solves:

  • osv-scan fails on every PR with 13 advisories
  • pyasn1 0.6.4 and pypdf 6.21.2 ship in the proxy image
  • dev-only minimatch 10.x has no fixed 10.x release

How it solves it:

  • uv lock --upgrade-package for pyasn1 0.6.5 and pypdf 6.21.4
  • Dated exclude-newer-package cutoff admits pypdf 6.21.4 today
  • minimatch override at 11.0.2 in both npm projects

User Flow

Before: a contributor's PR shows a red osv-scan check they did not cause

  1. They push a branch and open a PR against main at https://github.com/BerriAI/litellm/pulls
  2. The osv-scan check fails and lists 13 advisories: 4 on pyasn1 0.6.4, 7 on pypdf 6.21.2, and GHSA-g3hv-75wg-m249 on minimatch 10.x in the dashboard and VS Code extension locks
  3. A proxy user sends POST https://litellm-domain/utils/token_counter with a 6-page PDF and gets 5185 tokens for gpt-6.1-sol and 14135 for claude-sonnet-5-5

After: the same PR's osv-scan check passes, and the same PDF counts the same

  1. They push a branch and open a PR against main at https://github.com/BerriAI/litellm/pulls
  2. The osv-scan check passes with "No issues found"
  3. The same POST https://litellm-domain/utils/token_counter with the same PDF still returns 5185 and 14135 tokens

Relevant issues

This is dependabot's pyasn1 PR with the pypdf and minimatch bumps added on top, since the pyasn1 bump alone stayed red on the other two

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

No new tests: a version bump adds no behavior to test, so the existing pypdf tests and the live A/B below cover it

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

No E2E exception. pypdf is a runtime library the proxy reads for PDF token counts, so it gets a live base and tip A/B. pyasn1 is reached only through google-auth's pure-Python RSA fallback, which never loads when cryptography is installed (it always is). minimatch is dev-only, so the dashboard and extension builds prove that part

Shared setup: base worktree at the merge base a9b1814 (pyasn1 0.6.4, pypdf 6.21.2), tip worktree at df2a2cb (pyasn1 0.6.5, pypdf 6.21.4), osv-scanner v2.3.8 (checksum checked against the release's SHA256SUMS), and one proxy per worktree with no database and this config:

model_list:
  - model_name: gpt-6.1-sol
    litellm_params: {model: openai/gpt-6.1-sol, api_key: os.environ/OPENAI_API_KEY}
  - model_name: claude-sonnet-5-5
    litellm_params: {model: anthropic/claude-sonnet-5-5, api_key: os.environ/ANTHROPIC_API_KEY}

The PDF is 6 pages of plain text, and every request sends it as a base64 file part

How each leg runs

Each leg prints its commit and the pypdf and pyasn1 its proxy's venv loads, boots the proxy, and runs this script

Request script
import base64, json, sys, urllib.request
pdf_path, port = sys.argv[1], sys.argv[2]
data_url = "data:application/pdf;base64," + base64.b64encode(open(pdf_path, "rb").read()).decode()
def post(path, body):
    req = urllib.request.Request(f"http://127.0.0.1:{port}{path}", data=json.dumps(body).encode(),
        headers={"Authorization": "Bearer sk-qa-osv-1234", "Content-Type": "application/json"})
    with urllib.request.urlopen(req, timeout=180) as r:
        return r.status, dict(r.headers), json.loads(r.read())
msg = [{"role": "user", "content": [
    {"type": "text", "text": "How many pages does this PDF have? Answer with one number."},
    {"type": "file", "file": {"filename": "qa.pdf", "file_data": data_url}}]}]
for model in ("gpt-6.1-sol", "claude-sonnet-5-5"):
    s, _, b = post("/utils/token_counter", {"model": model, "messages": msg})
    print(f"POST /utils/token_counter model={model} -> {s} total_tokens={b.get('total_tokens')} tokenizer={b.get('tokenizer_type')}")
for model in ("gpt-6.1-sol", "claude-sonnet-5-5"):
    s, h, b = post("/v1/chat/completions", {"model": model, "messages": msg, "max_tokens": 200})
    print(f"POST /v1/chat/completions model={model} -> {s} answer={b['choices'][0]['message']['content']!r} prompt_tokens={b['usage']['prompt_tokens']} cached_tokens={(b['usage'].get('prompt_tokens_details') or {}).get('cached_tokens')} completion_tokens={b['usage']['completion_tokens']} reasoning_tokens={(b['usage'].get('completion_tokens_details') or {}).get('reasoning_tokens')} cost={h.get('x-litellm-response-cost')}")

The legs ran one after the other. A first run with both at once showed the base's gpt cost at 0.0125 because OpenAI's prompt cache was still cold, so this run prints cached_tokens

Before (a9b1814)

osv-scan

  1. osv-scanner scan source --config osv-scanner.toml -L uv.lock -L ui/litellm-dashboard/package-lock.json -L vscode-extension/package-lock.json (the workflow's own command)
The 13 findings
Total 4 packages affected by 13 known vulnerabilities (0 Critical, 11 High, 2 Medium, 0 Low, 0 Unknown) from 2 ecosystems.
| https://osv.dev/GHSA-2qm8-x737-gmw5 | 7.5 | PyPI | pyasn1          | 0.6.4  | 0.6.5  | uv.lock |
| https://osv.dev/GHSA-9m75-vc3g-4x39 | 7.5 | PyPI | pyasn1          | 0.6.4  | 0.6.5  | uv.lock |
| https://osv.dev/GHSA-fm9c-5rcf-2q5p | 7.5 | PyPI | pyasn1          | 0.6.4  | 0.6.5  | uv.lock |
| https://osv.dev/GHSA-mm57-4v3p-rchx | 7.5 | PyPI | pyasn1          | 0.6.4  | 0.6.5  | uv.lock |
| https://osv.dev/GHSA-42gh-23hr-vphw | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.3 | uv.lock |
| https://osv.dev/GHSA-4vqv-7265-gm2w | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.3 | uv.lock |
| https://osv.dev/GHSA-5849-834g-hvw5 | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.4 | uv.lock |
| https://osv.dev/GHSA-62m5-6wh8-28x7 | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.3 | uv.lock |
| https://osv.dev/GHSA-cggf-277g-3q54 | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.4 | uv.lock |
| https://osv.dev/GHSA-mfr5-77xh-9j7h | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.4 | uv.lock |
| https://osv.dev/GHSA-x3rh-gjgm-fmqc | 7.1 | PyPI | pypdf           | 6.21.2 | 6.21.3 | uv.lock |
| https://osv.dev/GHSA-g3hv-75wg-m249 | 6.9 | npm  | minimatch (dev) | 10.2.4 | 11.0.1 | ui/litellm-dashboard/package-lock.json |
| https://osv.dev/GHSA-g3hv-75wg-m249 | 6.9 | npm  | minimatch (dev) | 10.2.6 | 11.0.1 | vscode-extension/package-lock.json |

Exit code 1

PDF token count and chat through the proxy

  1. POST /utils/token_counter and POST /v1/chat/completions ("How many pages does this PDF have?") for each model
Output
commit a9b181489b
proxy venv: pypdf 6.21.2, pyasn1 0.6.4
POST /utils/token_counter model=gpt-6.1-sol -> 200 total_tokens=5185 tokenizer=openai_tokenizer
POST /utils/token_counter model=claude-sonnet-5-5 -> 200 total_tokens=14135 tokenizer=huggingface_tokenizer
POST /v1/chat/completions model=gpt-6.1-sol -> 200 answer='6' prompt_tokens=4985 cached_tokens=4982 completion_tokens=4 reasoning_tokens=0 cost=0.0005442
POST /v1/chat/completions model=claude-sonnet-5-5 -> 200 answer='6' prompt_tokens=17128 cached_tokens=0 completion_tokens=3 reasoning_tokens=0 cost=0.034286000000000004

After (df2a2cb)

osv-scan

  1. The same command
Output (no issues found)
Scanned .../uv.lock file and found 473 packages
Scanned .../ui/litellm-dashboard/package-lock.json file and found 863 packages
Scanned .../vscode-extension/package-lock.json file and found 232 packages
No issues found

Exit code 0

PDF token count and chat through the proxy

  1. The same requests
Output
commit df2a2cb81f
proxy venv: pypdf 6.21.4, pyasn1 0.6.5
POST /utils/token_counter model=gpt-6.1-sol -> 200 total_tokens=5185 tokenizer=openai_tokenizer
POST /utils/token_counter model=claude-sonnet-5-5 -> 200 total_tokens=14135 tokenizer=huggingface_tokenizer
POST /v1/chat/completions model=gpt-6.1-sol -> 200 answer='6' prompt_tokens=4985 cached_tokens=4982 completion_tokens=4 reasoning_tokens=0 cost=0.0005442
POST /v1/chat/completions model=claude-sonnet-5-5 -> 200 answer='6' prompt_tokens=17128 cached_tokens=0 completion_tokens=3 reasoning_tokens=0 cost=0.034286000000000004

minimatch 11.0.2 in the dev toolchains

Steps and results (pass)

Run at 7d402036f7, the same change on main 02a6a96. Its six dependency files are byte-identical to df2a2cb's, and nothing under ui/litellm-dashboard or vscode-extension differs between the two bases

  1. make bootstrap, then in ui/litellm-dashboard: installed minimatch is 11.0.2, npm run lint passes, npm run build passes
  2. In vscode-extension: npm ci, installed minimatch is 11.0.2, npm run typecheck && npm run build passes, npm run package (vsce package) writes litellm-vscode-0.1.0.vsix
  3. 11.x drops the top-level makeRe export and the MMRegExp type. The lint, build, and package runs above are where the dev parents (@typescript-eslint/typescript-estree and @vscode/vsce) call it

Unit tests and lock checks

Steps and results (pass)
  1. uv run pytest tests/unit/litellm_core_utils/test_token_counter.py with pypdf 6.21.4 installed: 463 passed, 1 skipped
  2. uv lock --check with CI's uv 0.10.9 passes on the new lock (run at 7d402036f7, same uv.lock and pyproject.toml bytes)

Dependents nobody tests (/live-pr-risk)

Nothing breaks beyond the CID-font caveat. RAG ingestion's local PDF extraction was not run live

Report

Only pyasn1 and pypdf differ between the base and tip environments. pypdf is read by PDF token counting (/utils/token_counter, /v1/responses/input_tokens, pre-call token checks, the rate limiter's token estimate, and PDF page pricing) and by RAG ingestion's local PDF text extraction. pyasn1 is imported only by google-auth's pure-Python RSA signer, and after the proxy and google-auth's signing modules load on the tip, no pyasn1 module is loaded

Breaking: none found. Each side ran one proxy with 2 workers and no database. Six PDF shapes went to /utils/token_counter for both models, and all 12 cells gave the same status and count on both sides

Backward incompatible: none beyond the CID-font change in Caveats

Regression risk: RAG ingestion into S3 Vectors, Vertex, and Bedrock knowledge bases runs the same PdfReader and extract_text calls as the Claude count cells, but driving it needs a vector store. OpenAI RAG ingestion uploads the raw file and never reads pypdf output

Not verified: those RAG ingestion paths, live. /v1/responses/input_tokens with an input_file PDF answers 400 on both sides from a known, unrelated bug in how Claude count routes convert file parts

PDF gpt-6.1-sol claude-sonnet-5-5 input_tokens
plain text 5176 14126 400
full-page image 1547 1548 400
text plus image 3268 6252 400
AES, empty password 5176 14126 400
truncated 99 99 400
bad startxref 5178 14129 400

Every cell is the same at a9b1814 and df2a2cb

Dependent Package Status
/utils/token_counter pypdf verified live
/v1/responses/input_tokens pypdf 400 both sides
Pre-call checks, rate limiter pypdf same counter
PDF page pricing pypdf same counter
RAG S3 Vectors, Vertex, Bedrock pypdf not run
OpenAI RAG ingestion none reads no pypdf
google-auth RSA signing pyasn1 not loaded
Dashboard, VS Code extension minimatch builds pass

Type

🚄 Infrastructure

Caveats (if any)

Medium

  • PDFs whose CID fonts store widths as indirect objects now count and extract differently, since pypdf 6.21.3 fixed that case (BUG: Resolve indirect widths in CID font /W arrays py-pdf/pypdf#4267). On that shape /utils/token_counter goes from 95 or 92 to 69 for gpt-6.1-sol and from 95 or 1562 to 1605 for claude-sonnet-5-5. The plain-text PDF above counts the same
  • The pypdf>=6.21.2,<7.0 floors stay, so a pip install over an existing 6.21.2 or 6.21.3 keeps it. The ask scoped this PR to the lock, which osv-scan and the Docker image read. Raising the floors to 6.21.4, as build(deps): bump mlflow, pypdf and setuptools to clear osv-scan #48110 did, is the alternative
  • The dated pypdf cutoff lets the lock take 6.21.4 before it clears the 3-day window at Oct 31 17:01 UTC, so a merge before then ships a release under 3 days old. After that the cutoff holds pypdf at its Oct 28 releases until it is removed. The brotli entry is still there 6 days past its TODO date, so a tracked follow-up removes both after 17:01 UTC today

Low

Bugbot summary

[!NOTE]
Medium Risk
pypdf is on the proxy PDF token-counting path; patch bumps are low risk but CID-font PDFs may count differently per upstream fixes. pyasn1 is transitive (google-auth); minimatch affects dev toolchains only.

Overview
This PR clears 13 osv-scan advisories by upgrading locked dependencies in Python and npm, without changing application code.

Python (uv.lock): pyasn1 moves 0.6.4 → 0.6.5 and pypdf 6.21.2 → 6.21.4 (used by the proxy for PDF token counting via PdfReader). Because pypdf 6.21.4 is still inside the repo’s 3-day exclude-newer window, pyproject.toml and uv.lock add a dated exclude-newer-package cutoff for pypdf (same pattern as brotli) so the lock can pin the patched release until the window passes.

npm (dev-only): minimatch is forced to 11.0.2 in the dashboard package.json overrides and a new overrides block in the VS Code extension, with lockfile refreshes that pull in @isaacs/nonrecursive-glob-match as a minimatch 11.x dependency.

Reviewed by Cursor Bugbot for commit df2a2cb. Bugbot is set up for automated code reviews on this repo. Configure here.

Bumps [pyasn1](https://github.com/pyasn1/pyasn1) from 0.6.4 to 0.6.5.
- [Release notes](https://github.com/pyasn1/pyasn1/releases)
- [Changelog](https://github.com/pyasn1/pyasn1/blob/main/CHANGES.rst)
- [Commits](pyasn1/pyasn1@v0.6.4...v0.6.5)

---
updated-dependencies:
- dependency-name: pyasn1
  dependency-version: 0.6.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot requested a review from a team October 31, 2026 00:22
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code labels Oct 31, 2026
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 43 untouched benchmarks


Comparing dependabot/uv/pyasn1-0.6.5 (df2a2cb) with main (a392a39)

Open in CodSpeed

pyasn1 0.6.4 -> 0.6.5 and pypdf 6.21.2 -> 6.21.4 in uv.lock, with a dated
exclude-newer-package cutoff that admits pypdf 6.21.4 before it clears the
3-day window. minimatch has no fixed 10.x release, so the dashboard's override
and a new vscode-extension override move it to 11.0.2.
@mateo-berri mateo-berri changed the title build(deps): bump pyasn1 from 0.6.4 to 0.6.5 build(deps): bump pyasn1, pypdf and minimatch to clear osv-scan Oct 31, 2026
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no new blocking issues found

Summary

Updates locked dependencies to clear the reported security advisories

  • Proxy builds now use newer pyasn1 and pypdf releases.
  • Dashboard and VS Code development tools now use minimatch 11.0.2.

Reviews (2) · Last reviewed commit: "build(deps): bump pyasn1, pypdf and mini..." · Reviewed by Greptile

Comment thread pyproject.toml Resolved
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit df2a2cb. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python:uv Pull requests that update python:uv code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant