Skip to content

fix(VULN-103416): bump mcp to >=1.27.2 for task isolation CVE - #186

Merged
shuningc merged 5 commits into
mainfrom
VULN-103416-mcp-upgrade
Aug 6, 2026
Merged

fix(VULN-103416): bump mcp to >=1.27.2 for task isolation CVE#186
shuningc merged 5 commits into
mainfrom
VULN-103416-mcp-upgrade

Conversation

@shuningc

@shuningc shuningc commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes VULN-103416: MCP Python SDK versions 1.23.0–1.27.1 have broken cross-client task isolation when server.experimental.enable_tasks() is used on MCP servers.
  • Adds a direct mcp >= 1.27.2, < 2 floor in pyproject.toml and refreshes poetry.lock so transitive usage (via crewai, openai-agents, litellm extras) resolves to mcp 1.29.0.
  • Pins the log-mcp-calls example requirements to the same minimum.

Risk assessment

  • Runtime exploitability: low — this repo does not call enable_tasks(); MCP usage is client-side only in the logging example.
  • FOSSA/compliance: required — lock previously had mcp==1.27.0 (affected range).

@shuningc
shuningc marked this pull request as ready for review July 30, 2026 00:49

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review was generated by the Astra agent (claude-opus-4-8). It may contain mistakes.

Verdict: needs_discussion — The version floor correctly remediates the CVE, but it is added as a mandatory core dependency, which contradicts the PR's stated scope and expands the base install footprint — worth confirming intent.

Comment thread pyproject.toml Outdated

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be a mandatory dependency of the SDK

Add a direct mcp floor in pyproject.toml and refresh poetry.lock so
transitive MCP SDK usage resolves to 1.29.0 (fixed release). Pin the
log-mcp-calls example requirements to the same minimum.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shuningc
shuningc force-pushed the VULN-103416-mcp-upgrade branch from 1304f38 to e81c7c7 Compare July 30, 2026 18:14
@shuningc
shuningc requested a review from fercor-cisco July 31, 2026 18:32

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review was generated by the Astra agent (claude-opus-4-8). It may contain mistakes.

Verdict: needs_discussion — Lock is floored to a safe mcp (FOSSA goal met), but mcp is an orphaned optional dependency (in no extra), so the floor won't propagate to published extras and Poetry will warn — confirm intended scope.

Comment thread pyproject.toml
opentelemetry-exporter-otlp-proto-http = "^1.38.0"
filelock = ">=3.20.1"
idna = ">=3.15,<4"
mcp = { version = ">=1.27.2,<2", optional = true }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 major (design): mcp is declared optional = true but is not referenced by any entry in [project.optional-dependencies] (openai, crewai, all, middleware, langchain — none list mcp). This makes it an orphaned optional dependency, which has two consequences:

  1. The floor does not reach SDK consumers. Poetry excludes optional deps that aren't part of any extra from the built distribution's Requires-Dist metadata. So pip install splunk-ao[openai] (or [crewai]/[all]) from a published wheel will resolve mcp purely under the transitive constraints of openai-agents/crewai/litellm, which permit the vulnerable 1.23.0–1.27.1 range. Only this repo's pinned poetry.lock is protected — which does satisfy FOSSA for the ticket, but the fix does not protect downstream installs.
  2. Poetry warns on an optional dependency that belongs to no extra (poetry check flags "declared as optional but not in any extra").

This is exactly what the earlier review comment asked for: keep it optional and add mcp>=1.27.2,<2 to the openai, crewai, and all extras so the floor is exported to the package metadata. If protecting only this repo's lock is the intended scope, please confirm in the PR description; otherwise add it to the extras.

Suggested change
mcp = { version = ">=1.27.2,<2", optional = true }
mcp = { version = ">=1.27.2,<2", optional = true }
# and add "mcp>=1.27.2,<2" to the openai, crewai, and all entries in
# [project.optional-dependencies] so the floor is exported to package metadata

🤖 Generated by the Astra agent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

shuningc and others added 3 commits August 3, 2026 23:23
Resolve poetry.lock conflict by keeping mcp 1.29.0 and updating pytest to
match main (>=9.0.3).

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire the optional mcp>=1.27.2,<2 constraint into package extras metadata so
downstream pip installs enforce the patched version, not only this repo lock.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve conflicts after requests>=2.33.0 landed on main; keep both
requests and mcp security floors and regenerate lock (mcp 1.29.0).

Co-authored-by: Cursor <cursoragent@cursor.com>

@fercor-cisco fercor-cisco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review was generated by the Astra agent (claude-opus-5). It may contain mistakes.

Verdict: approve — The CVE floor is correctly declared as an optional dep and wired into the openai/crewai/all extras so it reaches published metadata; lock resolves mcp to 1.29.0 (> fixed 1.27.2). Only a minor packaging wart remains.

Follow-ups

Suggested follow-up work that could be tracked as Jira tickets:

  • pyproject.toml:63-63: This PR is the second CVE-driven floor added directly to [tool.poetry.dependencies] purely to constrain a transitive dep (alongside filelock, idna, requests on lines 60-62). None of these carry a comment explaining why they exist, so a future cleanup could plausibly remove them as "unused direct deps" and silently reopen the vulnerability. Consider adding a short # VULN-xxxxx: floor for CVE-yyyy comment convention to each such pin, or grouping them under a clearly-labelled section.
  • poetry.lock:6564-6567: CI (.github/workflows/ci-tests.yaml) runs poetry install --all-extras --no-root but never poetry check --lock. Since security floors like this one are only enforced end-to-end when pyproject.toml and poetry.lock agree, a drifted lock (stale content-hash) would not fail the build. Adding a poetry check --lock step would catch that class of regression cheaply.

Comment thread pyproject.toml Outdated
openai = ["openai (>=2.8.0,<3.0.0)", "packaging (>=24.2,<25.0)", "openai-agents (>=0.4.0,<1.0.0)"]
crewai = ["crewai (>=0.152.0,<2.0.0); python_version < '3.14'", "litellm (>=1.83.14,<2.0.0); python_version < '3.14'"]
openai = ["openai (>=2.8.0,<3.0.0)", "packaging (>=24.2,<25.0)", "openai-agents (>=0.4.0,<1.0.0)", "mcp (>=1.27.2,<2)"]
crewai = ["crewai (>=0.152.0,<2.0.0); python_version < '3.14'", "litellm (>=1.83.14,<2.0.0); python_version < '3.14'", "mcp (>=1.27.2,<2)"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 minor (design): The mcp entry in the crewai extra is unconditional, while its two siblings in the same list (crewai, litellm) are both gated ; python_version < '3.14'.

Consequence: on Python 3.14, pip install splunk-ao[crewai] installs neither crewai nor litellm — so nothing in the resulting environment consumes MCP — yet it now pulls in mcp plus its full subtree (cryptography, uvicorn, starlette, sse-starlette, python-multipart, pyjwt[crypto], jsonschema, referencing, rpds-py). That includes a compiled crypto package and an ASGI server stack for an extra that is otherwise empty on 3.14. poetry.lock confirms this is the resolved behavior — the mcp marker contains a bare extra == "crewai" disjunct with no python_version guard (poetry.lock:2402).

Since MCP only reaches this extra transitively via crewai/litellm, the floor should carry the same Python gate so it applies exactly where the consuming package is installed.

Note this only applies to the crewai extra — leave openai and all unconditional, since openai-agents requires mcp>=1.19.0,<2 on all supported Pythons (poetry.lock:2980) and so genuinely needs the floor raised on 3.14 too. Likewise, do not add a python marker to the [tool.poetry.dependencies] entry on line 63, for the same reason.

Requires a poetry lock regen after the change.

Suggested change
crewai = ["crewai (>=0.152.0,<2.0.0); python_version < '3.14'", "litellm (>=1.83.14,<2.0.0); python_version < '3.14'", "mcp (>=1.27.2,<2)"]
crewai = ["crewai (>=0.152.0,<2.0.0); python_version < '3.14'", "litellm (>=1.83.14,<2.0.0); python_version < '3.14'", "mcp (>=1.27.2,<2); python_version < '3.14'"]

🤖 Generated by the Astra agent

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically true but minor, ok to ship as is.

fercor-cisco
fercor-cisco previously approved these changes Aug 5, 2026
Resolve pyproject.toml conflicts by keeping both mcp >=1.27.2 and
pdfminer-six >=20251107 floors, then regenerate poetry.lock.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shuningc
shuningc merged commit 1d2d26e into main Aug 6, 2026
13 checks passed
@shuningc
shuningc deleted the VULN-103416-mcp-upgrade branch August 6, 2026 00:43
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants