Skip to content

Commit 2389565

Browse files
jeremyederAmbient Code Botclaude
authored
fix(deps): resolve 13 Dependabot security alerts (#1284)
## Summary - Bump `next` 16.2.2 → 16.2.3 — fixes DoS via Server Components (alert #173) - Bump `aiohttp` ≥3.13.3 → ≥3.13.4 — fixes 9 CVEs: header injection, SSRF, DoS, credential leak, CRLF injection (alerts #149–158) - Bump `cryptography` 46.0.5 → 46.0.7 (transitive) — fixes buffer overflow (alert #172) - Bump `lupa` 2.6 → 2.7 (transitive) — fixes sandbox escape / RCE (alert #168) ### Remaining alerts (3) Alerts #144, #145, #146 (`fastmcp` 2.14.3 → 3.2.0) are **blocked on upstream**: `mcp-atlassian` 0.21.1 pins `fastmcp<2.15.0,>=2.13.0`. The CVEs affect fastmcp's OpenAPI provider and OAuth proxy — not in our code path, but the alerts will stay open until `mcp-atlassian` releases a version compatible with fastmcp 3.x. ## Test plan - [x] Frontend: 614 tests pass (`npx vitest run`) - [x] Runner: 543 tests pass (`uv run pytest tests/`) - [ ] CI passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Bumped frontend and runtime dependency minimums to newer patch releases. * **Refactor** * Code formatting and parameter/layout reflows across several modules for readability. * **Tests** * Cleaned up and reformatted unit tests, removing unused imports and improving fixture readability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Ambient Code Bot <bot@ambient-code.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e341b83 commit 2389565

9 files changed

Lines changed: 337 additions & 296 deletions

File tree

components/frontend/package-lock.json

Lines changed: 40 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"highlight.js": "^11.11.1",
4545
"lucide-react": "^0.542.0",
4646
"marked": "^17.0.4",
47-
"next": "16.2.2",
47+
"next": "16.2.3",
4848
"next-themes": "^0.4.6",
4949
"python-struct": "^1.1.3",
5050
"radix-ui": "^1.4.3",

components/runners/ambient-runner/ambient_runner/endpoints/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ async def switch_model(request: Request):
6363
return await _perform_model_switch(bridge, context, new_model, previous_model)
6464

6565

66-
async def _perform_model_switch(bridge, context, new_model: str, previous_model: str) -> dict:
66+
async def _perform_model_switch(
67+
bridge, context, new_model: str, previous_model: str
68+
) -> dict:
6769
"""Execute the model switch: update env, rebuild adapter, emit event."""
6870
logger.info(f"Switching model from '{previous_model}' to '{new_model}'")
6971

components/runners/ambient-runner/ambient_runner/mlflow_observability.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def initialize(
6161

6262
try:
6363
mlflow.set_tracking_uri(tracking_uri)
64-
exp_name = os.getenv("MLFLOW_EXPERIMENT_NAME", "ambient-code-sessions").strip()
64+
exp_name = os.getenv(
65+
"MLFLOW_EXPERIMENT_NAME", "ambient-code-sessions"
66+
).strip()
6567
if not exp_name:
6668
exp_name = "ambient-code-sessions"
6769
mlflow.set_experiment(exp_name)
@@ -92,7 +94,13 @@ def initialize(
9294
self.session_id,
9395
exp_name,
9496
)
95-
_ = (prompt, model, workflow_url, workflow_branch, workflow_path) # reserved for tags
97+
_ = (
98+
prompt,
99+
model,
100+
workflow_url,
101+
workflow_branch,
102+
workflow_path,
103+
) # reserved for tags
96104
return True
97105

98106
def _apply_mask(self, value: Any) -> Any:

components/runners/ambient-runner/ambient_runner/observability.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,16 @@
5555
resolve_message_mask_fn,
5656
)
5757

58-
# Alias for tests and legacy imports
59-
_privacy_masking_function = privacy_mask_message_data
6058
from ambient_runner.platform.security_utils import (
6159
sanitize_exception_message,
6260
sanitize_model_name,
6361
validate_and_sanitize_for_logging,
6462
with_sync_timeout,
6563
)
6664

65+
# Alias for tests and legacy imports
66+
_privacy_masking_function = privacy_mask_message_data
67+
6768
# Canonical token key names used across usage dicts from the Claude Agent SDK.
6869
_TOKEN_KEYS = (
6970
"input_tokens",

components/runners/ambient-runner/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies = [
1313
"uvicorn[standard]>=0.41.0",
1414
"ag-ui-protocol>=0.1.13",
1515
"pydantic>=2.12.5",
16-
"aiohttp>=3.13.3",
16+
"aiohttp>=3.13.4",
1717
"requests>=2.32.5",
1818
"pyjwt>=2.11.0",
1919
]

components/runners/ambient-runner/tests/test_mcp_config.py

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
"""Tests for MCP config loading with custom/project/disabled server merging."""
22

33
import json
4-
import os
5-
import tempfile
64
from pathlib import Path
7-
from unittest.mock import patch
85

9-
import pytest
106

117
from ambient_runner.platform.config import load_mcp_config
128
from ambient_runner.platform.context import RunnerContext
@@ -31,7 +27,10 @@ def test_loads_from_default_file(self, tmp_path: Path):
3127
json.dumps(
3228
{
3329
"mcpServers": {
34-
"context7": {"type": "http", "url": "https://mcp.context7.com/mcp"},
30+
"context7": {
31+
"type": "http",
32+
"url": "https://mcp.context7.com/mcp",
33+
},
3534
"webfetch": {"command": "uvx", "args": ["mcp-server-fetch"]},
3635
}
3736
}
@@ -51,7 +50,10 @@ def test_merges_custom_session_servers(self, tmp_path: Path):
5150
json.dumps(
5251
{
5352
"mcpServers": {
54-
"context7": {"type": "http", "url": "https://mcp.context7.com/mcp"},
53+
"context7": {
54+
"type": "http",
55+
"url": "https://mcp.context7.com/mcp",
56+
},
5557
}
5658
}
5759
)
@@ -76,7 +78,15 @@ def test_merges_custom_session_servers(self, tmp_path: Path):
7678
def test_merges_project_level_servers(self, tmp_path: Path):
7779
"""Project-level custom servers should be merged with defaults."""
7880
mcp_file = tmp_path / ".mcp.json"
79-
mcp_file.write_text(json.dumps({"mcpServers": {"default-server": {"type": "http", "url": "https://default.com"}}}))
81+
mcp_file.write_text(
82+
json.dumps(
83+
{
84+
"mcpServers": {
85+
"default-server": {"type": "http", "url": "https://default.com"}
86+
}
87+
}
88+
)
89+
)
8090

8191
project_mcp = {
8292
"custom": {
@@ -127,8 +137,14 @@ def test_disables_default_servers(self, tmp_path: Path):
127137
json.dumps(
128138
{
129139
"mcpServers": {
130-
"context7": {"type": "http", "url": "https://mcp.context7.com/mcp"},
131-
"deepwiki": {"type": "http", "url": "https://mcp.deepwiki.com/mcp"},
140+
"context7": {
141+
"type": "http",
142+
"url": "https://mcp.context7.com/mcp",
143+
},
144+
"deepwiki": {
145+
"type": "http",
146+
"url": "https://mcp.deepwiki.com/mcp",
147+
},
132148
"webfetch": {"command": "uvx", "args": ["mcp-server-fetch"]},
133149
}
134150
}
@@ -180,7 +196,13 @@ def test_returns_none_when_all_disabled(self, tmp_path: Path):
180196
"""Should return None when all servers are disabled."""
181197
mcp_file = tmp_path / ".mcp.json"
182198
mcp_file.write_text(
183-
json.dumps({"mcpServers": {"only-server": {"type": "http", "url": "https://only.com"}}})
199+
json.dumps(
200+
{
201+
"mcpServers": {
202+
"only-server": {"type": "http", "url": "https://only.com"}
203+
}
204+
}
205+
)
184206
)
185207
custom = {"disabled": ["only-server"]}
186208
ctx = _make_context(
@@ -195,7 +217,11 @@ def test_returns_none_when_all_disabled(self, tmp_path: Path):
195217
def test_handles_invalid_custom_json(self, tmp_path: Path):
196218
"""Should handle invalid JSON in CUSTOM_MCP_SERVERS gracefully."""
197219
mcp_file = tmp_path / ".mcp.json"
198-
mcp_file.write_text(json.dumps({"mcpServers": {"s1": {"type": "http", "url": "https://s1.com"}}}))
220+
mcp_file.write_text(
221+
json.dumps(
222+
{"mcpServers": {"s1": {"type": "http", "url": "https://s1.com"}}}
223+
)
224+
)
199225
ctx = _make_context(
200226
{
201227
"MCP_CONFIG_FILE": str(mcp_file),

0 commit comments

Comments
 (0)