Skip to content

fix: upgrade deepdiff to 8.6.1 (CVE-2025-58367) - #23

Open
anupamme wants to merge 2 commits into
uber:mainfrom
anupamme:fix-repo-adr-cve-2025-58367-deepdiff
Open

fix: upgrade deepdiff to 8.6.1 (CVE-2025-58367)#23
anupamme wants to merge 2 commits into
uber:mainfrom
anupamme:fix-repo-adr-cve-2025-58367-deepdiff

Conversation

@anupamme

@anupamme anupamme commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Upgrade deepdiff from 8.1.1 to 8.6.1 to fix CVE-2025-58367.

Vulnerability

Field Value
ID CVE-2025-58367
Severity CRITICAL
Scanner trivy
Rule CVE-2025-58367
File Detection/uv.lock (dependency: deepdiff)
Assessment Likely exploitable

Description: DeepDiff is a project focused on Deep Difference and search of any Pyt ...

Evidence

Scanner confirmation: trivy rule CVE-2025-58367 flagged this pattern.

Changes

  • Detection/pyproject.toml
  • Detection/uv.lock

Behavior 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

@CLAassistant

CLAassistant commented Aug 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pengyuzhang pengyuzhang 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.

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.

@pengyuzhang
pengyuzhang dismissed their stale review August 6, 2026 04:56

Re-posting as a plain comment instead — this is feedback, not a merge block.

Automated dependency upgrade by OrbisAI Security
@anupamme
anupamme force-pushed the fix-repo-adr-cve-2025-58367-deepdiff branch from 0b4f4d0 to af73479 Compare August 6, 2026 06:23
@anupamme

anupamme commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

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.

@pengyuzhang

Copy link
Copy Markdown
Collaborator

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:

Package main this PR
deepdiff 8.1.1 8.6.1 intended ✅
jupyter-server 2.20.0 2.16.0 downgrade ❌
pyjwt 2.13.0 2.10.1 downgrade ❌

These aren't merge-staleness artifacts — the merge base is current main HEAD (7d7faf9), zero commits behind.

Tracing the history:

Per OSV, the two downgrades reintroduce 11 advisories in order to remove 1. All 11 are currently fixed on main:

pyjwt 2.10.1 (6 reintroduced, 0 remaining in 2.13.0):

jupyter-server 2.16.0 (5 reintroduced, 0 remaining in 2.20.0):

Both packages are transitive (pyjwtmsalazure-identity; jupyter-serverjupyterlab/notebook via the notebook extra), which lowers the impact but doesn't erase it — and makes it exactly the kind of regression that goes unnoticed until the next scan.

@pengyuzhang

Copy link
Copy Markdown
Collaborator

Blocking: uv.lock was regenerated by an older uv than the project uses.

The lockfile header goes revision = 3revision = 1, and every upload-time = "..." attribute is stripped from all ~359 package entries. That accounts for essentially the entire +2651/−2651 churn — the real change is two lines.

main has been on revision 3 since the initial public release, so this is a lockfile format downgrade, not an update. The stale resolver is also the most likely cause of the pyjwt and jupyter-server downgrades noted above.

Practical consequence: the next person to run uv lock on a current uv will regenerate revision 3 with upload-time restored, producing another ~2600-line diff.

Suggested fix for both issues: regenerate with a current uv, scoped to the one package —

uv lock --upgrade-package deepdiff

That moves only deepdiff, leaves the other 358 entries byte-identical, and preserves revision = 3 + upload-time. The PR then becomes a ~10-line reviewable diff.

Two things worth flagging about detectability:

  • uv lock --check passes on the current head, so tooling won't catch this. The lock is internally consistent with pyproject.toml; it just pins worse versions.
  • CI runs uv sync --extra dev without --locked/--frozen, so a drifting or regressed lockfile can't fail the build either. Adding --locked to the Detection and Sensor jobs in ci.yml would make this class of regression visible mechanically — worth doing separately, since this automation will keep producing these PRs.

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.

Regenerated with `uv lock --upgrade-package deepdiff` to update only
deepdiff without downgrading other packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@anupamme
anupamme force-pushed the fix-repo-adr-cve-2025-58367-deepdiff branch from af73479 to 11e080f Compare August 6, 2026 17:22
@anupamme

anupamme commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review comments. Pls review.

@pengyuzhang

Copy link
Copy Markdown
Collaborator

Thanks for the quick turnaround — the pin is exactly right now.

Confirmed good: deepdiff==8.6.1 keeps the exact-pin convention, and a package-set comparison of this lock against main shows the change is fully contained:

packages only in PR lock:   []
packages only in main lock: []
version changes:            {'deepdiff': ('8.1.1', '8.6.1')}

One package moved, nothing added or removed — so the 9.x major bump and the new cachebox dependency are both gone, and the AgentDojo DeepDiff usage now only sees a patch-level change within 8.x. uv lock --check passes (368 packages resolved).

One thing to fix before merge: the lockfile lost 76 environment markers.

The diff is 164 lines touching packages unrelated to deepdiff (nvidia-*, numpy, torch, semgrep, glom, …), all of this shape:

- { name = "numpy", version = "1.26.4", ..., marker = "python_full_version < '3.12'" },
+ { name = "numpy", version = "1.26.4", ... },

Marker counts: main has 202, this branch has 126.

I checked whether that's just a uv-version difference, and it isn't:

lockfile marker = count
main as-is 202
main regenerated with uv 0.12.1 202
fresh rm uv.lock && uv lock from this branch's pyproject 176
this branch's submitted lock 126

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 nvidia-* packages lose their sys_platform == 'linux' guards, so a macOS/ARM install could pull wheels it previously skipped. The resolved package set is unchanged, so this is about install-time conditionals rather than the dependency graph — but it's unnecessary risk to carry in a security patch.

Requested: regenerate the lock cleanly on top of the deepdiff==8.6.1 pyproject —

cd Detection && rm uv.lock && uv lock

That 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants