Fix MVS-2023-gwm8-m3c2: bump langchain-core, langchain-openai, langsmith (4 CVEs) - #273
Conversation
…int to >=1.3.3 Fixes unsafe deserialization of attacker-controlled objects through overly broad load() allowlists in RunnableWithMessageHistory, astream_log(), and astream_events(v1). The previously-locked langchain-core 1.2.28 fell inside the vulnerable >=1.0.0,<=1.3.2 range; 1.3.3 is the first patched 1.x release. Resolver picked langchain-core 1.6.2. Reproduces PR microsoft#272 (closed unmerged due to fork branch-protection block) against a fresh branch so it can be reviewed and merged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
dbezic (@dbezic) Rick Brighenti (@rbrighenti) Krishnadheeraj (@DheerajPannala) could one of you review/approve? (submitted from a fork so I can't formally request review via the UI — flagging directly instead, same as #269/#272/#285.) This reproduces #272's already-CI-green, already-approved change on a branch with maintainer-edit access enabled, so it can actually be merged this time. Note: if this repo's integration/secret-dependent CI checks fail on a fork PR, that's the known fork-secrets limitation (pull_request workflows from forks don't get repo secrets), not a problem from this dependency bump — the full unit suite (tox -e py312, 800 passed) already covers it locally. |
There was a problem hiding this comment.
🟢 Approval recommended
The patched dependency constraint and lockfile resolution address the vulnerability.
Pull request overview
Updates the centralized langchain-core dependency constraint to remediate the reported deserialization vulnerability.
Changes:
- Raises the minimum version to
>=1.3.3. - Resolves
langchain-coreto1.6.2.
File summaries
| File | Description |
|---|---|
pyproject.toml |
Updates the centralized security constraint. |
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Clarification on advisory mappingI want to correct something in this PR''s framing: I checked GitHub''s public advisory database exhaustively (
What this PR does verifiably fix: What it may not do: if |
…h-w4cj-qxq8 (langsmith) Rounds out the MVS-2023-gwm8-m3c2 remediation started in the previous commit by fixing the remaining vulnerable packages flagged under the same S360/CG alert bundle: - langchain-openai >=1.1.14 (dev-dependencies): fixes CVE-2026-41488, an SSRF/DNS-rebinding TOCTOU in _url_to_size()'s validate-then-fetch pattern used by get_num_tokens_from_messages for image token counting. - langsmith >=0.8.18 (override-dependencies, transitive-only dependency): fixes CVE-2026-45134 (prompt-pull deserialization trust-boundary bypass, patched in 0.8.0) and GHSA-f4xh-w4cj-qxq8 (TracingMiddleware arbitrary file read via an unvalidated trace-propagation header, patched in 0.8.18, which supersedes 0.8.0 and is used as the floor here). Local verification (this branch, all three fixes applied together): - uv lock: resolves clean (langchain-openai 1.1.12 -> 1.6.0, langsmith 0.7.31 -> 0.12.1, langchain-core -> 1.6.1) - uv sync --locked --all-extras --dev: clean - tox -e verify-constraints: PASS - tox -e lint: PASS - tox -e format: PASS - tox -e py312: 800 passed, 3 skipped, 9 deselected, 0 failed (unchanged from the langchain-core-only commit - no behavioral regressions from bumping langchain-openai/langsmith) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update: expanded to cover the full MVS-2023-gwm8-m3c2 alert bundleThe user who owns this S360/Component-Governance alert (
Changes added in the second commit:
Local verification (all three fixes applied together):
This should clear all four CVE-level findings under the |
There was a problem hiding this comment.
🟡 Changes recommended
Ensure the published langsmith minimum is enforced and reconcile the documented and locked langchain-core versions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 1/2 changed files
- Comments generated: 1
- Review effort level: Lite
| # unvalidated trace-propagation header; fixed in 0.8.18, which supersedes 0.8.0). | ||
| override-dependencies = [ | ||
| "azure-ai-projects>=1.0.0b12,<2.0.0", | ||
| "langsmith >= 0.8.18", |
Correction: this PR fixes 4 real CVEs, but CANNOT clear MVS-2023-gwm8-m3c2 itselfThe alert owner shared the authoritative source advisory (
What this means for this PR: the The only two ways to actually clear
Leaving this PR open for the 4 real CVE fixes; the alert itself needs one of the two decisions above from the service owner. |
|
Closing per repo owner's decision after reviewing the full advisory: MVS-2023-gwm8-m3c2 flags langchain/langchain-core at ALL VERSIONS (a permanent 'Use Discouraged' policy, not a patchable CVE) — no version bump can ever clear it. Replacing this PR with a clean removal PR instead. See #274. |
Summary
Fixes a known vulnerability in the
langchain-coredependency by bumping the centralized constraint in rootpyproject.toml's[tool.uv] constraint-dependenciesfrom>=0.1.0to>=1.3.3(no upper bound, matching the other unbounded AI-framework constraints in the same block).CVE fixed
GHSA-pjwx-r37v-7724 / CVE-2026-44843 - LangChain unsafe deserialization of attacker-controlled objects through overly broad
load()allowlists (affectsRunnableWithMessageHistory,astream_log(),astream_events(v1), and related serialization/deserialization round-trips). The previously-lockedlangchain-core 1.2.28fell inside the vulnerable>=1.0.0,<=1.3.2range.1.3.3is the first patched 1.x release; the resolver picked up1.6.2.This maps to S360 action item
MVS-2023-gwm8-m3c2(Component Governance alert, Location:/Agent365-python/uv.lock).Why a new PR instead of reviewing #272
#272 proposed this exact fix and passed CI + got one approval, but it was opened from a fork with
maintainerCanModify: false, somergeStateStatuswasBLOCKEDand it could never actually be merged - it was closed unmerged andmainis still on the vulnerablelangchain-core >= 0.1.0constraint today. This PR reproduces the identical change with maintainer-edit access enabled so it can be merged directly.Usage check: the only consumer of
langchain_corein this repo ismicrosoft-agents-a365-observability-extensions-langchain(a tracing/observability shim -BaseTracer,callbacks,messages.BaseMessage). It never calls the vulnerableRunnableWithMessageHistory/astream_log/astream_events(v1)paths, so the version bump alone fully remediates the alert with no code changes required.Local verification (this branch)
uv lock(withPYTHONPATH=./versioning/helperper CI): resolves clean,langchain-core 1.2.28 -> 1.6.2uv sync --locked --all-extras --dev: cleantox -e verify-constraints: PASStox -e lint: PASStox -e format: PASStox -e py312: 800 passed, 3 skipped, 9 deselected (full suite, including the langchain observability extension's own tests, all passing against the new version)Reviewers
Requesting review from dbezic, rbrighenti, DheerajPannala (same reviewers as #272 and the sibling google-adk security fix, #269).
This PR was generated by an AI assistant (S360 automation) reproducing the already-reviewed #272 change on a mergeable branch. Please review carefully before merging.