Skip to content

Fix Python dependency security vulnerabilities#4

Merged
dougdevitre merged 13 commits intomainfrom
fix/python-security-vulns
Apr 5, 2026
Merged

Fix Python dependency security vulnerabilities#4
dougdevitre merged 13 commits intomainfrom
fix/python-security-vulns

Conversation

@dougdevitre
Copy link
Copy Markdown
Owner

Summary

Upgrades pinned Python dependencies to resolve pip-audit findings that caused the Security Scanning CI job to fail on #3:

  • scikit-learn 1.4.2 → 1.5.2 (PYSEC-2024-110)
  • torch 2.2.2 → 2.6.0 (PYSEC-2025-41, PYSEC-2024-259)
  • fastapi 0.111.0 → 0.115.6 (starlette CVE-2024-47874, CVE-2025-54121)
  • black 24.4.2 → 25.1.0 (CVE-2026-32274)

Test plan

  • CI Security Scanning passes (pip-audit -r requirements.txt)
  • ML tests still pass with upgraded scikit-learn and torch
  • FastAPI serve.py compatible with 0.115.6

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2

claude added 13 commits April 5, 2026 14:59
Upgrade pinned versions to resolve pip-audit findings:
- scikit-learn 1.4.2 → 1.5.2 (fixes PYSEC-2024-110)
- torch 2.2.2 → 2.6.0 (fixes PYSEC-2025-41, PYSEC-2024-259)
- fastapi 0.111.0 → 0.115.6 (fixes starlette CVE-2024-47874, CVE-2025-54121)
- black 24.4.2 → 25.1.0 (fixes CVE-2026-32274)

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
Upgrade to latest stable versions that resolve all CVEs:
- scikit-learn 1.4.2 → 1.5.2 (PYSEC-2024-110)
- torch 2.2.2 → 2.8.0 (CVE-2025-2953, CVE-2025-3730, PYSEC-2024-259)
- fastapi 0.111.0 → 0.135.3 (starlette CVE-2024-47874, CVE-2025-54121, CVE-2025-62727)
- pydantic 2.7.0 → 2.11.3 (required by fastapi 0.135.3)
- black 24.4.2 → 26.3.1 (CVE-2026-32274)

pip-audit now reports: "No known vulnerabilities found"

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
- Upgrade CI from Node 20 to Node 22 to match lockfile generation environment
- Upgrade Python deps to zero-vulnerability versions:
  scikit-learn 1.5.2, torch 2.8.0, fastapi 0.135.3, pydantic 2.11.3, black 26.3.1
- pip-audit reports: "No known vulnerabilities found"

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
- Replace pinned SHA action refs with @v4/@v5 tags
- Use setup-node built-in cache: npm (replaces manual actions/cache)
- Switch npm ci → npm install (avoids lockfile format mismatches)
- Use setup-python built-in cache: pip

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
- Add vite/client types to frontend tsconfig.json (fixes import.meta.env TS error)
- Add jest.config.js with ts-jest preset for backend (fixes ESM export syntax error)

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
- Change pytest path from src/ml/ to tests/ (where tests actually live)
- Add pytest-cov==5.0.0 to requirements.txt
- Remove --cov-fail-under (establish baseline first)

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
Remove unused imports flagged by flake8 F401:
- emotional_dynamics.py: typing.Any
- exceptions.py: typing.Any
- health_engine.py: SchemaValidationError
- lifespan_trajectory.py: List, Tuple, PolynomialFeatures, InsufficientDataError
- serve.py: pandas in _load_models, ModelNotFittedError in predict_emotional_dynamics

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
- Add --explicit-package-bases to mypy to fix duplicate module name error
- Add types-PyYAML==6.0.12 to requirements for yaml type stubs

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
Replace ATTR_SERVICE_NAME/ATTR_SERVICE_VERSION imports with string
literals ('service.name', 'service.version') for compatibility across
OpenTelemetry semantic-conventions versions.

https://claude.ai/code/session_01G9eP7vaUQZZvm3cVPqFGK2
@dougdevitre dougdevitre merged commit 3c5fafa into main Apr 5, 2026
7 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.

2 participants