fix: upgrade deepdiff to 8.6.1 (CVE-2025-58367) - #23
Conversation
pengyuzhang
left a comment
There was a problem hiding this comment.
Thanks for picking this up — CVE-2025-58367 is one of the few criticals in our Dependabot backlog, so the fix is welcome. A few things to resolve before merge.
Verified locally (macOS, Python 3.12): uv lock --check consistent (369 packages), uv sync --extra dev clean, uv run pytest tests/ -q → 53 passed.
1. The constraint resolves to 9.1.0, not 8.6.1.
The title says "upgrade deepdiff to 8.6.1", but >=8.6.1 is a floor rather than a pin, and the lockfile resolves to 9.1.0 — a major-version bump. It also pulls in a new transitive dependency, cachebox==5.2.3 (a Rust-backed cache), which wasn't previously in the tree:
- deepdiff==8.1.1
+ deepdiff==9.1.0
+ cachebox==5.2.3
2. deepdiff is load-bearing for the vendored AgentDojo suites.
It has no direct imports under guardrail/ or the top-level scripts, but the vendored benchmark uses it for utility checks:
benchmark/agentdojo/benchmarks/agentdojo/default_suites/v1/workspace/task_suite.py:
from deepdiff import DeepDiff
WorkspaceDeepDiff = partial(DeepDiff, exclude_paths=..., exclude_regex_paths=...)
benchmark/agentdojo/benchmarks/agentdojo/default_suites/v1/travel/task_suite.py:
from deepdiff import DeepDiff
These comparisons decide whether a task's environment changed, i.e. they feed benchmark pass/fail. A major-version change in comparison or exclude_paths semantics could shift AgentDojo results silently. Detection/tests/ doesn't exercise the AgentDojo suites, so the passing test run above doesn't cover this.
3. It changes an intentional exact pin.
deepdiff==8.1.1 was one of 22 == pins in pyproject.toml. Per the Detection README, those exist for benchmark reproducibility against the paper's evaluation. Switching to >= means a later uv lock regeneration can drift without review, on a package that feeds AgentDojo ground-truth comparisons.
Requested change — one line, keeps everything else as-is:
- "deepdiff>=8.6.1",
+ "deepdiff==8.6.1",8.6.1 is the patched version per the advisory, so this still closes the CVE while preserving the pinning convention, avoiding the 9.x major bump, and likely avoiding the new cachebox dependency. Please regenerate uv.lock after the change.
If you'd prefer to take 9.1.0 deliberately, that's fine too, but it should be pinned as ==9.1.0 and accompanied by an AgentDojo run confirming the diff semantics are unchanged.
Re-posting as a plain comment instead — this is feedback, not a merge block.
Automated dependency upgrade by OrbisAI Security
0b4f4d0 to
af73479
Compare
|
Hello, saw that it was only feedback not a merge block, so I addressed the issues anyway. Let me know if anything is still missing. |
|
Blocking: the regenerated lockfile carries two silent downgrades that revert already-merged security fixes. Diffing the base and head lockfiles package-by-package (359 packages each), three versions changed — one intended, two not:
These aren't merge-staleness artifacts — the merge base is current Tracing the history:
Per OSV, the two downgrades reintroduce 11 advisories in order to remove 1. All 11 are currently fixed on
Both packages are transitive ( |
|
Blocking: The lockfile header goes
Practical consequence: the next person to run Suggested fix for both issues: regenerate with a current That moves only Two things worth flagging about detectability:
|
af73479 to
11e080f
Compare
|
Addressed review comments. Pls review. |
|
Thanks for the quick turnaround — the pin is exactly right now. Confirmed good: One package moved, nothing added or removed — so the 9.x major bump and the new One thing to fix before merge: the lockfile lost 76 environment markers. The diff is 164 lines touching packages unrelated to deepdiff ( - { name = "numpy", version = "1.26.4", ..., marker = "python_full_version < '3.12'" },
+ { name = "numpy", version = "1.26.4", ... },Marker counts: I checked whether that's just a uv-version difference, and it isn't:
So the submitted lock doesn't match what uv produces from the same inputs — something dropped conditional markers (older uv, a different tool, or a manual edit). The practical concern is that entries like the CUDA Requested: regenerate the lock cleanly on top of the cd Detection && rm uv.lock && uv lockThat should shrink the diff to just the deepdiff block and preserve the markers. Once the lock diff is contained, this is good to merge — happy to re-check straight away. |
11e080f to
7445b1d
Compare
|
addressed. pls review. |
|
My apologies — my previous comment gave you bad advice, and it made this revision worse than the one before it. Two corrections. 1. My marker analysis was wrong, and the previous revision ( I claimed the 76 dropped Doing it properly — start from That is exactly what 2. It re-resolves everything from scratch, so every non-pinned dependency floats to latest. This revision's effect:
5,747 changed lines. For this repo that's a problem beyond noise: To fix — restore the incremental lock: cd Detection
git checkout main -- uv.lock # discard the full re-resolve
# pyproject.toml already has deepdiff==8.6.1
uv lock # incremental; touches only what must change
Sorry for the round trip — the pin itself has been right since |
Use exact pin instead of >= floor constraint to preserve the project's pinning convention for AgentDojo benchmark dependencies, avoid the 9.x major-version bump, and remove the unnecessary cachebox transitive dep. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7445b1d to
6815d26
Compare
|
addressed. pls review. |
pengyuzhang
left a comment
There was a problem hiding this comment.
Approving — this is exactly right now, and thanks for bearing with the round trip caused by my earlier bad advice.
Verified locally (macOS, Python 3.12, uv 0.12.1):
| check | result |
|---|---|
pyproject.toml diff |
one line, deepdiff==8.1.1 → ==8.6.1 (exact pin preserved) |
| lock diff | 164 lines (83+/83−) |
| package count | 368, unchanged from main |
| packages added / removed | none / none |
| version changes | {'deepdiff': ('8.1.1', '8.6.1')} — one, only |
llamafirewall entries |
3, intact (Table 2 baseline) |
| torch / CUDA stack | untouched (2.7.1, cu12) |
uv lock --check |
368 packages resolved |
uv sync --extra dev |
clean swap to 8.6.1 |
uv run pytest tests/ -q |
53 passed |
The strongest check: I regenerated the lock independently — git checkout main -- uv.lock, apply only the pyproject edit, uv lock — and the result is byte-for-byte identical to the file in this PR (diff -q clean). No hand-editing, no stray resolution; it's precisely what the tooling produces from these inputs. That also confirms the 126-vs-202 marker = count is uv 0.12.1's normalization, as I retracted earlier.
Closes CVE-2025-58367 (critical: DeepDiff class pollution → DoS/RCE), one of the four distinct criticals in our Dependabot backlog. Patch-level within 8.x, so the vendored AgentDojo suites' DeepDiff comparison semantics are unaffected.
Summary
Upgrade deepdiff from 8.1.1 to 8.6.1 to fix CVE-2025-58367.
Vulnerability
CVE-2025-58367Detection/uv.lock(dependency:deepdiff)Description: DeepDiff is a project focused on Deep Difference and search of any Pyt ...
Evidence
Scanner confirmation: trivy rule
CVE-2025-58367flagged this pattern.Changes
Detection/pyproject.tomlDetection/uv.lockBehavior Preservation
The change is scoped to 2 files on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.
This change addresses a pattern flagged by static analysis. The code path handles user-influenced input and the fix reduces the attack surface against both manual and automated exploitation.
Automated security fix by OrbisAI Security