Skip to content

fix: upgrade langchain-core to address CVE-2025-68664 - #606

Merged
afida23 merged 1 commit into
mainfrom
pinDependency
Aug 14, 2026
Merged

fix: upgrade langchain-core to address CVE-2025-68664#606
afida23 merged 1 commit into
mainfrom
pinDependency

Conversation

@afida23

@afida23 afida23 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What changed

Bumps langchain-core 0.2.1 → 0.3.81 and pydantic 2.4.0 → 2.7.4 in both backend requirements files of the gen-ai-chatbot blueprint. langchain-core versions before 0.3.81 are vulnerable to CVE-2025-68664; pydantic must be >=2.7.4 for langchain-core 0.3.x.

langchain-core 0.3 moves its base classes to native pydantic v2, which silently disables v1-style validators registered via the langchain_core.pydantic_v1 shim. Five files under app/agents/ are migrated to pydantic v2 APIs (@model_validator/@field_validator, ConfigDict, model_fields) so the agent feature keeps working.

Testing

  • Dependency resolution verified for both requirements files (Python 3.11)
  • Ran the backend unit suite on the new pins and compared against a baseline run on the old pins: same pass/fail results, with the remaining failures pre-existing (tests needing deployed AWS infra). Without the validator migration, AgentExecutor construction fails on langchain-core 0.3.x (test_create_react_agent); with it, the test passes construction again
  • Ran the blueprint's Bedrock integration tests (test_langchain.py, test_stream.py) with live AWS credentials: model invocation and streaming succeed through the migrated agent code on langchain-core 0.3.81 (Mistral variants; the Claude variants fail only because the tests hardcode the now-retired claude-v3-haiku model, unrelated to this change)
  • requirements.txt installs cleanly on the python:3.11.6-slim-bookworm base image

Issues

@afida23
afida23 merged commit 72d0f1f into main Aug 14, 2026
5 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