Skip to content

security: update vulnerable dependencies - #159

Merged
anhnh2002 merged 5 commits into
FSoft-AI4Code:mainfrom
DeijoseDevelop:security/dependency-updates
Nov 23, 2026
Merged

anhnh2002 merged 5 commits into
FSoft-AI4Code:mainfrom
DeijoseDevelop:security/dependency-updates

Conversation

@DeijoseDevelop

@DeijoseDevelop DeijoseDevelop commented Nov 12, 2026 •

Copy link
Copy Markdown

Summary

pip-audit -r requirements.txt reported 271 findings (173 unique advisories) across 22 Python packages, and npm audit in tests/mermaid reported 9 vulnerable packages. This PR moves the affected pins to the smallest compatible fixed versions, declares the patched minimums for the affected transitive dependencies in pyproject.toml, and leaves both audits clean.

Python highlights

Package Before After
aiohttp 3.12.15 3.14.4
GitPython 3.1.40 3.2.1
litellm 1.77.0 1.100.4
mcp 1.12.3 1.30.0
starlette / fastapi 0.47.2 / 0.116.1 1.3.1 / 0.140.0
pydantic-ai 1.0.6 pydantic-ai-slim 1.107.7
pydantic 2.11.7 2.12.0
logfire 4.1.0 5.6.0
openai 1.107.1 2.29.0
tornado 6.5.1 6.6.1
urllib3 2.5.0 2.8.0
requests 2.32.4 2.33.0
python-multipart 0.0.20 0.0.31
certifi 2025.8.3 2026.10.23
idna 3.10 3.20
pyasn1 0.6.1 0.6.5
protobuf 5.29.5 5.29.6
pygments 2.19.2 2.20.0
python-dotenv 1.1.1 1.2.2
filelock 3.18.0 4.2.1
fsspec 2025.7.0 2026.6.0
anyio 4.10.0 4.14.2
brotli 1.1.0 1.2.1
opentelemetry-* 1.36.0 / 0.57b0 1.45.2 / 0.66b2

requirements.txt also pins the new transitive dependencies required by those versions (httpx2, httpcore2, griffelib, logfire-sdk, the OTLP exporter helpers, cryptography, PyJWT, and the keyring runtime helpers).

pyproject.toml now declares the patched minimums for the affected transitive dependencies (aiohttp>=3.14.4, urllib3>=2.8.0, tornado>=6.6.1, plus the rest of the audited set), so a normal package install that doesn't use requirements.txt cannot resolve to the vulnerable versions.

npm / frontend

  • Mermaid moved from 11.9.0 to 12.3.0 in tests/mermaid, codewiki/src/fe/templates.py, codewiki/templates/github_pages/viewer_template.html, and docs/index.html. The remaining KaTeX advisory in Mermaid 11 is only fixed in Mermaid 12; the existing 37 parser fixtures pass with the new major.
  • npm audit now reports 0 vulnerabilities.

Compatibility notes

  • pydantic-ai → pydantic-ai-slim[openai,google]. The pydantic-ai meta package installs every provider extra; its mistralai>=2 extra requires opentelemetry-semantic-conventions<0.61, which conflicts with the fixed OpenTelemetry 1.45.2 stack. CodeWiki only imports pydantic-ai's OpenAI and Google model/providers, and the slim package provides those same pydantic_ai modules.
  • Removed unused pins. openai-agents was not imported anywhere and pinned openai<2; griffe was only used by the old pydantic-ai and is replaced by griffelib. Both removals were required for the OpenAI and pydantic-ai fixes to resolve.
  • FastAPI 0.140.0 is the first release whose Starlette requirement has no <1.0 upper bound, so it is the smallest FastAPI bump that allows the fixed Starlette 1.3.1.
  • Tornado 6.6.1 addresses CVE-2026-126347 (GHSA-5cjw-f85j-cv6r), flagged against 6.6 in the post-review audit.
  • No application logic changed apart from the Mermaid CDN version and the changelog entry.

Verification

  • pip-audit -r requirements.txt → No known vulnerabilities found.
  • npm audit --prefix tests/mermaid --package-lock-only → 0 vulnerabilities.
  • Clean Python 3.12 venv: pip install -r requirements.txt, then pip install -e . --no-deps.
  • pytest -p no:cacheprovider -o addopts="" tests/ -q → 740 passed, 25 skipped.
  • npm ci --prefix tests/mermaid --ignore-scripts --no-audit --no-fund && npm test --prefix tests/mermaid → 37 Mermaid parser fixtures passed.
  • pip check → No broken requirements found.
  • CLI, FastAPI web app, docs viewer, MCP server, and LLM service modules import successfully; basic TestClient requests work.

Refresh the pinned Python dependencies and the Mermaid frontend asset to versions that address the known advisories reported by pip-audit and npm audit.

Highlights:
- aiohttp 3.14.4, GitPython 3.2.1, litellm 1.100.4, mcp 1.30.0
- starlette 1.3.1 with fastapi 0.140.0
- pydantic 2.12.0 and pydantic-ai-slim 1.107.7 (replaces the pydantic-ai meta package, which pulled extras that conflict with the fixed OpenTelemetry stack)
- logfire 5.6.0, openai 2.29.0, tornado 6.6, urllib3 2.8.0
- Mermaid 12.3.0 in the web viewer and CDN templates

The unused openai-agents and griffe entries were dropped because they pinned openai<2 and griffe<2, which cannot coexist with the fixed versions.

Verified with pip-audit (0 findings), npm audit (0 findings), and the test suite (740 passed, 25 skipped).
@anhnh2002

Copy link
Copy Markdown
Collaborator

Thanks for tackling this! I reproduced the 740 passing tests and the Mermaid checks. Two follow-ups before merging:

  • Bump Tornado to 6.6.1; the current audit flags 6.6 for CVE-2026-126347.
  • Add the patched transitive minimums to pyproject.toml, particularly aiohttp>=3.14.4 and urllib3>=2.8.0. A normal package upgrade can still keep the vulnerable versions because it doesn’t use requirements.txt.

The compatibility checks otherwise looked good.

Tornado 6.6 is flagged by CVE-2026-126347 (GHSA-5cjw-f85j-cv6r), so the
pin moves to 6.6.1. pyproject.toml now declares the patched minimums for
the affected transitive dependencies (aiohttp>=3.14.4, urllib3>=2.8.0,
tornado>=6.6.1, and the rest of the audited set) so installs that do not
use requirements.txt cannot resolve to vulnerable versions.
@DeijoseDevelop

Copy link
Copy Markdown
Author

Thanks for tackling this! I reproduced the 740 passing tests and the Mermaid checks. Two follow-ups before merging:

  • Bump Tornado to 6.6.1; the current audit flags 6.6 for CVE-2026-126347.
  • Add the patched transitive minimums to pyproject.toml, particularly aiohttp>=3.14.4 and urllib3>=2.8.0. A normal package upgrade can still keep the vulnerable versions because it doesn’t use requirements.txt.

The compatibility checks otherwise looked good.

Fixed

Raise the package minimum and requirements pin so upgrades cannot retain vulnerable protobuf 6.x releases. Bump temporalio to 1.18.0, the first release that permits protobuf 6, to keep the pinned requirements compatible.
@anhnh2002
anhnh2002 merged commit bbf7438 into FSoft-AI4Code:main Nov 23, 2026
3 checks passed
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.

3 participants