Skip to content

build(deps): bump filelock to clear osv-scan - #48802

Open
keko950 wants to merge 1 commit into
BerriAI:mainfrom
keko950:litellm_bump_filelock
Open

keko950 wants to merge 1 commit into
BerriAI:mainfrom
keko950:litellm_bump_filelock

Conversation

@keko950

@keko950 keko950 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

osv-scan is failing on the locked filelock 3.32.7 because ReadWriteLock advisories (GHSA-v4x8-3wr5-3wq8 and friends) only clear in 4.2.1+, which needs Python 3.11. This splits the pin the same way pillow and lunary already do, so 3.11+ locks a fixed 4.x release and Python 3.10 stays on 3.20.3, which is below every affected range. The dated filelock ignore in osv-scanner.toml can go away

Details

TLDR

Problem this solves:

  • osv-scan fails on locked filelock 3.32.7
  • Only fixed release is 4.2.1+, which needs Python >= 3.11

How it solves it:

  • Split the filelock pin by Python version, pillow/lunary style
  • 3.11+ locks filelock 4.2.4 (>= 4.2.1), 3.10 stays on 3.20.3
  • Drop the GHSA-v4x8-3wr5-3wq8 IgnoredVulns entry

filelock 4.x requires Python 3.11 or newer, and there is no 3.x release with the fixes. The advisories all start at 3.20.4 (soft-lock Windows DoS at 3.22.0), so capping 3.10 at <3.20.4 lands on 3.20.3 with an empty vulnerability list on PyPI. litellm only imports FileLock / Timeout in the proxy CLI profile helpers, never ReadWriteLock

The same marker split is mirrored in packaging/litellm-core/pyproject.toml. The lock was generated with uv 0.12.24 so the uv.lock diff only touches filelock. This replaces the "defer filelock" path that #48302 was taking for the same advisories

User Flow

Before: a contributor's PR to main fails osv-scan on filelock even when it touches no dependencies

  1. They open a PR against main
  2. The osv-scan check fails, listing GHSA-v4x8-3wr5-3wq8 (and related filelock advisories) against filelock 3.32.7

After: the same PR's osv-scan no longer reports those filelock advisories

  1. They open a PR against main that includes this lock
  2. osv-scan resolves filelock 4.2.4 on Python 3.11+ and 3.20.3 on 3.10, with no filelock findings

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

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

Shared setup: from the repo root, inspect the locked filelock rows and the direct dependency markers

Before (de40c0a)

  1. rg -n 'name = "filelock"|filelock>=|filelock<' pyproject.toml packaging/litellm-core/pyproject.toml uv.lock osv-scanner.toml
  2. Observed: a single filelock package at 3.32.7, filelock>=3.16.1,<4.0 in both pyprojects, and GHSA-v4x8-3wr5-3wq8 ignored in osv-scanner.toml

After (8f59453)

  1. Same rg as Before
  2. Observed: filelock 3.20.3 under python_full_version < '3.11', filelock 4.2.4 under python_full_version >= '3.11', version-marker splits in both pyprojects, and no filelock entry left in osv-scanner.toml

Type

🚄 Infrastructure

Caveats (if any)

Low

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

filelock 4.2.1+ is the only fixed release and requires Python >= 3.11,
so the pin is split like pillow: 4.2.4 on 3.11+ and 3.20.3 on 3.10,
which sits below every affected range. The GHSA-v4x8-3wr5-3wq8 ignore
is removed.
@keko950
keko950 requested a review from a team October 28, 2026 10:52
@codecov

codecov Bot commented Oct 28, 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 28, 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

✅ 35 untouched benchmarks


Comparing keko950:litellm_bump_filelock (8f59453) with main (b97fcf1)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (6ba77b7) during the generation of this report, so b97fcf1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants