Skip to content

fix(security): Upgrade fastmcp to v3 to address CVE-2025-69872#2294

Merged
xingyaoww merged 1 commit intomainfrom
fix/upgrade-fastmcp-v3-security
Mar 5, 2026
Merged

fix(security): Upgrade fastmcp to v3 to address CVE-2025-69872#2294
xingyaoww merged 1 commit intomainfrom
fix/upgrade-fastmcp-v3-security

Conversation

@aivong-openhands
Copy link
Copy Markdown
Contributor

@aivong-openhands aivong-openhands commented Mar 4, 2026

This upgrade addresses Dependabot alert #44 by removing the diskcache dependency (vulnerable to unsafe pickle deserialization).

Changes:

  • Update fastmcp requirement from >=2.11.3 to >=3.0.0
  • fastmcp v3 uses py-key-value-aio[filetree] instead of [disk], which removes the diskcache dependency

All 2429 SDK tests pass with the upgrade.

Resolves: https://github.com/OpenHands/software-agent-sdk/security/dependabot/44

Summary

[fill in a summary of this PR]

Checklist

  • If the PR is changing/adding functionality, are there tests to reflect this?
  • If there is an example, have you run the example to make sure that it works?
  • If there are instructions on how to run the code, have you followed the instructions and made sure that it works?
  • If the feature is significant enough to require documentation, is there a PR open on the OpenHands/docs repository with the same branch name?
  • Is the github CI passing?

Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:e554199-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-e554199-python \
  ghcr.io/openhands/agent-server:e554199-python

All tags pushed for this build

ghcr.io/openhands/agent-server:e554199-golang-amd64
ghcr.io/openhands/agent-server:e554199-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:e554199-golang-arm64
ghcr.io/openhands/agent-server:e554199-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:e554199-java-amd64
ghcr.io/openhands/agent-server:e554199-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:e554199-java-arm64
ghcr.io/openhands/agent-server:e554199-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:e554199-python-amd64
ghcr.io/openhands/agent-server:e554199-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:e554199-python-arm64
ghcr.io/openhands/agent-server:e554199-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:e554199-golang
ghcr.io/openhands/agent-server:e554199-java
ghcr.io/openhands/agent-server:e554199-python

About Multi-Architecture Support

  • Each variant tag (e.g., e554199-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., e554199-python-amd64) are also available if needed

This upgrade addresses Dependabot alert #44 by removing the diskcache
dependency (vulnerable to unsafe pickle deserialization).

Changes:
- Update fastmcp requirement from >=2.11.3 to >=3.0.0
- fastmcp v3 uses py-key-value-aio[filetree] instead of [disk], which
  removes the diskcache dependency

All 2429 SDK tests pass with the upgrade.

Resolves: https://github.com/OpenHands/software-agent-sdk/security/dependabot/44

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

API breakage checks (Griffe)

Result: Failed

Log excerpt (first 1000 characters)

============================================================
Checking openhands-sdk (openhands.sdk)
============================================================
Comparing openhands-sdk 1.11.5 against 1.11.4
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): load_public_skills
::notice title=openhands-sdk API::Ignoring Field metadata-only change (non-breaking): temperature
::warning file=openhands-sdk/openhands/sdk/llm/llm.py,line=196,title=LLM.top_p::Attribute value was changed: `Field(default=1.0, ge=0, le=1)` -> `Field(default=None, ge=0, le=1, description='Nucleus sampling parameter. Defaults to None (uses provider default). Set to a value between 0 and 1 to control diversity of outputs.')`
::error title=SemVer::Breaking changes detected (1); require at least minor version bump from 1.11.x, but new is 1.11.5

============================================================
Checking openhands-workspace (openhands.workspace)
============================

Action log

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

Agent server REST API breakage checks (OpenAPI)

Result: Passed

Action log

Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

🟡 Acceptable - Security fix is necessary and pragmatic, but this needs eval verification before merge.

Key Concern: Major version bump (2.x → 3.x) with no visible code changes. Major versions signal breaking changes - where are the adaptations? Per repo guidelines, changes to SDK dependencies that could affect agent behavior should be flagged for lightweight eval testing.

Action Items:

  1. Run examples (see inline comment)
  2. Verify no direct imports of removed transitive deps
  3. Run lightweight evals to catch behavioral changes tests might miss

Verdict: Security fix is good, approach is sound, but flag for human maintainer to verify with evals before merge.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL20095543972% 
report-only-changed-files is enabled. No files were changed during this commit :)

@aivong-openhands
Copy link
Copy Markdown
Contributor Author

On my local openhands repo, I pointed https://github.com/OpenHands/OpenHands/blob/main/openhands/app_server/sandbox/sandbox_spec_service.py#L16 to the python arm64 agent server image built in this PR https://github.com/OpenHands/software-agent-sdk/actions/runs/22659801479/job/65677208258?pr=2294.

Public Deepwiki MCP server has already been configured:
Screenshot 2026-03-04 at 8 00 47 AM

Screenshot 2026-03-04 at 7 59 46 AM Screenshot 2026-03-04 at 7 59 52 AM

Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

🟢 Good taste - Pragmatic security fix

Verdict: ✅ Approve and merge

This is a straightforward dependency upgrade to address CVE-2025-69872 (unsafe pickle deserialization in diskcache). The change is minimal, well-motivated, and properly vetted:

✅ Real security vulnerability addressed
✅ API compatibility confirmed (previous investigation in threads)
✅ All 2429 tests passing
✅ CI passing (pre-commit, sdk-tests, tools-tests, agent-server-tests)
✅ Lock file changes show clean removal of vulnerable dep

On the unresolved thread about examples: The core functionality is tested via the test suite. Since fastmcp v3 maintains API compatibility for the methods this project uses (as confirmed in the investigation), and all tests pass, the risk is minimal. If you want extra confidence, run one example with MCP features before merge, but this is not blocking given the evidence.

Key insight: Security fixes for transitive dependencies with proven API compatibility should not be overthought. Ship it.

@aivong-openhands aivong-openhands marked this pull request as ready for review March 4, 2026 18:54
Copy link
Copy Markdown
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

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

🟢 Good taste - Pragmatic security fix

Linus-Style Analysis:

This is textbook "good taste" engineering:

  • Real problem: CVE-2025-69872 (unsafe pickle deserialization) is an actual security vulnerability, not a theoretical concern
  • Simplest solution: One-line dependency upgrade. No code changes needed because the upstream library fixed it properly
  • No breakage: API compatibility confirmed in previous investigation (thread resolved), 2429 tests green
  • Clean dependencies: Lock file shows diskcache cleanly removed, replaced with safer backend (py-key-value-aio[filetree])

Data Structure Check: ✅ No data structure changes
Complexity Check: ✅ No code complexity added
Breaking Change Risk: ✅ Verified compatible via migration guide review
Testing: ✅ Full test suite passing

VERDICT: ✅ Technically sound and ready

However - Repository Policy Note:

Per this repo's guidelines, I'm leaving this as COMMENT rather than APPROVE because:

  • fastmcp handles MCP server functionality which could affect agent behavior
  • Even with API compatibility confirmed, dependency upgrades in agent tooling warrant lightweight eval testing
  • This follows the "flag for eval on behavior-affecting changes" policy

Recommendation: Run a quick smoke test with MCP tools enabled (if applicable to your eval suite), then merge. This is a good fix that should land quickly.

Key Insight: Sometimes the best code review is recognizing when upstream did the work right - fastmcp v3 eliminated the problem at the source.

@xingyaoww xingyaoww added test-examples Run all applicable "examples/" files. Expensive operation. integration-test Runs the integration tests and comments the results labels Mar 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

Hi! I started running the integration tests on your PR. You will receive a comment with the results shortly.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

🔄 Running Examples with openhands/claude-haiku-4-5-20251001

Generated: 2026-03-05 10:06:53 UTC

Example Status Duration Cost
01_standalone_sdk/02_custom_tools.py ✅ PASS 23.5s $0.02
01_standalone_sdk/03_activate_skill.py ✅ PASS 20.1s $0.02
01_standalone_sdk/05_use_llm_registry.py ✅ PASS 12.3s $0.01
01_standalone_sdk/07_mcp_integration.py ✅ PASS 44.5s $0.04
01_standalone_sdk/09_pause_example.py ✅ PASS 15.6s $0.01
01_standalone_sdk/10_persistence.py ✅ PASS 27.0s $0.02
01_standalone_sdk/11_async.py ✅ PASS 32.6s $0.03
01_standalone_sdk/12_custom_secrets.py ✅ PASS 10.0s $0.01
01_standalone_sdk/13_get_llm_metrics.py ✅ PASS 26.0s $0.02
01_standalone_sdk/14_context_condenser.py ✅ PASS 2m 51s $0.20
01_standalone_sdk/17_image_input.py ✅ PASS 14.7s $0.01
01_standalone_sdk/18_send_message_while_processing.py ✅ PASS 15.6s $0.01
01_standalone_sdk/19_llm_routing.py ✅ PASS 24.2s $0.02
01_standalone_sdk/20_stuck_detector.py ✅ PASS 15.5s $0.02
01_standalone_sdk/21_generate_extraneous_conversation_costs.py ✅ PASS 11.3s $0.00
01_standalone_sdk/22_anthropic_thinking.py ✅ PASS 14.4s $0.01
01_standalone_sdk/23_responses_reasoning.py ✅ PASS 54.1s $0.01
01_standalone_sdk/24_planning_agent_workflow.py ✅ PASS 5m 10s $0.38
01_standalone_sdk/25_agent_delegation.py ❌ FAIL
Timed out after 600 seconds
10m 0s $0.29
01_standalone_sdk/26_custom_visualizer.py ✅ PASS 20.8s $0.02
01_standalone_sdk/28_ask_agent_example.py ✅ PASS 30.0s $0.03
01_standalone_sdk/29_llm_streaming.py ✅ PASS 36.1s $0.03
01_standalone_sdk/30_tom_agent.py ✅ PASS 21.8s $0.01
01_standalone_sdk/31_iterative_refinement.py ✅ PASS 4m 40s $0.33
01_standalone_sdk/32_configurable_security_policy.py ✅ PASS 20.4s $0.02
01_standalone_sdk/34_critic_example.py ✅ PASS 2m 35s $0.22
01_standalone_sdk/36_event_json_to_openai_messages.py ✅ PASS 11.7s $0.01
01_standalone_sdk/37_llm_profile_store.py ✅ PASS 4.4s $0.00
01_standalone_sdk/38_browser_session_recording.py ❌ FAIL
Timed out after 600 seconds
10m 0s $0.03
01_standalone_sdk/39_llm_fallback.py ✅ PASS 10.7s $0.01
01_standalone_sdk/40_acp_agent_example.py ❌ FAIL
Exit code 1
9.8s --
01_standalone_sdk/41_task_tool_set.py ❌ FAIL
Exit code 1
4.5s --
01_standalone_sdk/42_file_based_subagents.py ✅ PASS 54.1s $0.06
02_remote_agent_server/01_convo_with_local_agent_server.py ✅ PASS 57.1s $0.05
02_remote_agent_server/02_convo_with_docker_sandboxed_server.py ❌ FAIL
Exit code 1
5.1s --
02_remote_agent_server/03_browser_use_with_docker_sandboxed_server.py ❌ FAIL
Exit code 1
5.1s --
02_remote_agent_server/04_convo_with_api_sandboxed_server.py ❌ FAIL
Exit code 1
5m 12s --
02_remote_agent_server/07_convo_with_cloud_workspace.py ✅ PASS 23.4s $0.02
02_remote_agent_server/08_convo_with_apptainer_sandboxed_server.py ❌ FAIL
Exit code 1
5.4s --
04_llm_specific_tools/01_gpt5_apply_patch_preset.py ✅ PASS 21.9s $0.04
04_llm_specific_tools/02_gemini_file_tools.py ✅ PASS 52.9s $0.06
05_skills_and_plugins/01_loading_agentskills/main.py ✅ PASS 16.6s $0.01
05_skills_and_plugins/02_loading_plugins/main.py ✅ PASS 7.3s $0.01

❌ Some tests failed

Total: 43 | Passed: 35 | Failed: 8 | Total Cost: $2.11

Failed examples:

  • examples/01_standalone_sdk/25_agent_delegation.py: Timed out after 600 seconds
  • examples/01_standalone_sdk/38_browser_session_recording.py: Timed out after 600 seconds
  • examples/01_standalone_sdk/40_acp_agent_example.py: Exit code 1
  • examples/01_standalone_sdk/41_task_tool_set.py: Exit code 1
  • examples/02_remote_agent_server/02_convo_with_docker_sandboxed_server.py: Exit code 1
  • examples/02_remote_agent_server/03_browser_use_with_docker_sandboxed_server.py: Exit code 1
  • examples/02_remote_agent_server/04_convo_with_api_sandboxed_server.py: Exit code 1
  • examples/02_remote_agent_server/08_convo_with_apptainer_sandboxed_server.py: Exit code 1

View full workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

🧪 Integration Tests Results

Overall Success Rate: 96.7%
Total Cost: $1.07
Models Tested: 4
Timestamp: 2026-03-05 09:59:12 UTC

📁 Detailed Logs & Artifacts

Click the links below to access detailed agent/LLM logs showing the complete reasoning process for each model. On the GitHub Actions page, scroll down to the 'Artifacts' section to download the logs.

📊 Summary

Model Overall Tests Passed Skipped Total Cost Tokens
litellm_proxy_deepseek_deepseek_reasoner 100.0% 7/7 1 8 $0.07 1,516,944
litellm_proxy_gemini_3_pro_preview 100.0% 8/8 0 8 $0.49 281,096
litellm_proxy_anthropic_claude_sonnet_4_6 87.5% 7/8 0 8 $0.44 254,383
litellm_proxy_moonshot_kimi_k2_thinking 100.0% 7/7 1 8 $0.08 279,729

📋 Detailed Results

litellm_proxy_deepseek_deepseek_reasoner

  • Success Rate: 100.0% (7/7)
  • Total Cost: $0.07
  • Token Usage: prompt: 1,495,366, completion: 21,578, cache_read: 1,412,480, reasoning: 10,590
  • Run Suffix: litellm_proxy_deepseek_deepseek_reasoner_fd9ec81_deepseek_v3_2_reasoner_run_N8_20260305_094914
  • Skipped Tests: 1

Skipped Tests:

  • t08_image_file_viewing: This test requires a vision-capable LLM model. Please use a model that supports image input.

litellm_proxy_gemini_3_pro_preview

  • Success Rate: 100.0% (8/8)
  • Total Cost: $0.49
  • Token Usage: prompt: 274,654, completion: 6,442, cache_read: 78,556, reasoning: 3,834
  • Run Suffix: litellm_proxy_gemini_3_pro_preview_fd9ec81_gemini_3_pro_run_N8_20260305_094917

litellm_proxy_anthropic_claude_sonnet_4_6

  • Success Rate: 87.5% (7/8)
  • Total Cost: $0.44
  • Token Usage: prompt: 248,698, completion: 5,685, cache_read: 168,648, cache_write: 79,802, reasoning: 943
  • Run Suffix: litellm_proxy_anthropic_claude_sonnet_4_6_fd9ec81_claude_sonnet_4_6_run_N8_20260305_094918

Failed Tests:

  • t02_add_bash_hello: Shell script is not executable (Cost: $0.05)

litellm_proxy_moonshot_kimi_k2_thinking

  • Success Rate: 100.0% (7/7)
  • Total Cost: $0.08
  • Token Usage: prompt: 274,236, completion: 5,493, cache_read: 215,296
  • Run Suffix: litellm_proxy_moonshot_kimi_k2_thinking_fd9ec81_kimi_k2_thinking_run_N8_20260305_094913
  • Skipped Tests: 1

Skipped Tests:

  • t08_image_file_viewing: This test requires a vision-capable LLM model. Please use a model that supports image input.

@xingyaoww
Copy link
Copy Markdown
Collaborator

This LGTM since the MCP example test is passing 🙏 Going to merge this

@xingyaoww xingyaoww merged commit 193c677 into main Mar 5, 2026
81 of 83 checks passed
@xingyaoww xingyaoww deleted the fix/upgrade-fastmcp-v3-security branch March 5, 2026 11:29
zparnold added a commit to zparnold/software-agent-sdk that referenced this pull request Mar 5, 2026
…ands#2294)

Cherry-picked from upstream 193c677. uv.lock regenerated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-test Runs the integration tests and comments the results test-examples Run all applicable "examples/" files. Expensive operation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants