Skip to content

Commit 1b07024

Browse files
authored
fix: Update dependencies to address 14 Dependabot security alerts (#94)
* fix: update dependencies to address security vulnerabilities Security fixes for Dependabot alerts: - mcp: 1.9.2 -> 1.26.0 (fixes CVE for DNS rebinding, DoS vulnerabilities) - filelock: 3.18.0 -> 3.20.3 (fixes TOCTOU symlink vulnerabilities) - starlette: 0.46.2 -> 0.50.0 (fixes Range header DoS, multipart DoS) - python-multipart: 0.0.20 -> 0.0.22 (fixes arbitrary file write) - urllib3: removed (no longer needed as transitive dep) - requests: removed (no longer needed as transitive dep) Updated pyproject.toml to require mcp>=1.23.0 (was >=1.7.0). All 63 tests pass. * fix: resolve mypy strict errors after dependency upgrades - Remove redundant cast(Diff, ...) in repo_context.py (pygit2 types improved) - Add None check for patch iteration in repo_context.py - Remove unused 'cast' and 'Diff' imports - Remove obsolete type: ignore comments in bash_state.py (pexpect types improved)
1 parent 29e0ab1 commit 1b07024

File tree

4 files changed

+1198
-667
lines changed

4 files changed

+1198
-667
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies = [
2626
"psutil>=7.0.0",
2727
"tree-sitter>=0.24.0",
2828
"tree-sitter-bash>=0.23.3",
29-
"mcp>=1.7.0",
29+
"mcp>=1.23.0",
3030
"wcmatch>=10.1",
3131
]
3232

src/wcgw/client/bash_state/bash_state.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def start_shell(
382382
try:
383383
shell = pexpect.spawn(
384384
cmd,
385-
env=overrideenv, # type: ignore[arg-type]
385+
env=overrideenv,
386386
echo=True,
387387
encoding="utf-8",
388388
timeout=CONFIG.timeout,
@@ -398,7 +398,7 @@ def start_shell(
398398

399399
shell = pexpect.spawn(
400400
"/bin/bash --noprofile --norc",
401-
env=overrideenv, # type: ignore[arg-type]
401+
env=overrideenv,
402402
echo=True,
403403
encoding="utf-8",
404404
timeout=CONFIG.timeout,

src/wcgw/client/repo_ops/repo_context.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22
from collections import deque
33
from pathlib import Path # Still needed for other parts
4-
from typing import Optional, cast
4+
from typing import Optional
55

6-
from pygit2 import Diff, GitError
6+
from pygit2 import GitError
77
from pygit2.enums import SortMode
88
from pygit2.repository import Repository
99

@@ -111,13 +111,15 @@ def get_recent_git_files(repo: Repository, count: int = 10) -> list[str]:
111111
# If we have a parent, get the diff between the commit and its parent
112112
if commit.parents:
113113
parent = commit.parents[0]
114-
diff = cast(Diff, repo.diff(parent, commit))
114+
diff = repo.diff(parent, commit)
115115
else:
116116
# For the first commit, get the diff against an empty tree
117117
diff = commit.tree.diff_to_tree(context_lines=0)
118118

119119
# Process each changed file in the diff
120120
for patch in diff:
121+
if patch is None:
122+
continue
121123
file_path = patch.delta.new_file.path
122124

123125
# Skip if we've already seen this file or if the file was deleted

0 commit comments

Comments
 (0)