Skip to content

fix(deps): bump dify-agent Pillow to 13.0.0 for CVE fixes - #44871

Merged
wylswz merged 2 commits into
langgenius:mainfrom
xhdnoah:fix/agent-pillow-bump-13
Oct 27, 2026
Merged

wylswz merged 2 commits into
langgenius:mainfrom
xhdnoah:fix/agent-pillow-bump-13

Conversation

@xhdnoah

@xhdnoah xhdnoah commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Bump dify-agent Pillow constraint from pillow>=11.3.0,<13 to pillow>=13.0.0,<14 and update dify-agent/uv.lock.
  • Pillow 12.3.0 is affected by multiple critical and high severity CVEs (CVE-2026-96639, CVE-2026-112393, CVE-2026-112398, CVE-2026-112403, CVE-2026-112900, and others). The reported fixed version is 13.0.0.
  • The previous <13 cap prevented the lockfile from resolving to the fixed version.
  • Compatibility: Pillow 13.0.0 has 5 breaking changes (removed deprecated APIs, XMP info no longer returns tuple, removed non-image ImageCms modes, removed GifImagePlugin._save_netpbm, removed ExifTags.IFD.Makernote, dropped Python 3.10). Verified that dify-agent/src does not use any of these APIs. dify-agent requires Python >=3.13, well above Pillow 13.0.0's >=3.11 floor.

Lockfile note

The local uv 0.8.9 downgrades the lockfile format from revision 5 to revision 3 and introduces unrelated httpcore2/httpx2 marker changes. To keep the diff minimal, the Pillow package entry and server-extra specifier were edited manually; the lockfile revision is preserved at 5.

Test plan

  • make check (dify-agent lint)
  • make test (dify-agent tests)
  • uv sync --frozen --no-dev --extra server installs successfully with Pillow 13.0.0
  • Verify Pillow version: python -c "import PIL; print(PIL.__version__)"

Pillow 12.3.0 is affected by multiple critical and high severity CVEs
(CVE-2026-96639, CVE-2026-112393, CVE-2026-112398, CVE-2026-112403,
CVE-2026-112900, and others). The reported fixed version is 13.0.0.

The previous constraint `pillow>=11.3.0,<13` capped resolution below
13.0.0, so the lockfile could not pick up the fix. Raise the floor to
`pillow>=13.0.0,<14` and update dify-agent/uv.lock to Pillow 13.0.0.

The lockfile revision is preserved (no re-format). Only the Pillow
package entry and the server-extra specifier are changed.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@xhdnoah
xhdnoah requested a review from a team October 27, 2026 08:03
@github-actions github-actions Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Oct 27, 2026
@wylswz

wylswz commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Testing failed.

@xhdnoah xhdnoah changed the title fix(deps): bump dify-agent Pillow to 13.0.0 for CVE fixes fix(deps): bump dify-agent Pillow to 13.0.0 and pydantic-ai-slim to 2.53.0 for CVE fixes Oct 27, 2026
@xhdnoah
xhdnoah marked this pull request as draft October 27, 2026 08:20
@github-actions github-actions Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Oct 27, 2026
@xhdnoah
xhdnoah force-pushed the fix/agent-pillow-bump-13 branch from be16f02 to 1fce605 Compare October 27, 2026 09:07
@xhdnoah xhdnoah changed the title fix(deps): bump dify-agent Pillow to 13.0.0 and pydantic-ai-slim to 2.53.0 for CVE fixes fix(deps): bump dify-agent Pillow to 13.0.0 for CVE fixes Oct 27, 2026
@xhdnoah

xhdnoah commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Note on pydantic-ai-slim CVE-2026-107286

pydantic-ai-slim 2.31.0 is in the affected range (>=2.10.0, <2.53.0) for CVE-2026-107286, but this PR does not upgrade it.

Reason: dify-agent does not use ConcurrencyLimitedModel or limit_model_concurrency — the only code paths affected by this CVE. Verified via grep across dify-agent/src and dify-agent/tests: zero references to ConcurrencyLimiter, limit_model_concurrency, ConcurrencyLimitedModel, or max_concurrency.

The CVE requires both conditions to be exploitable:

  1. Model wrapped with ConcurrencyLimitedModel / limit_model_concurrency
  2. Streaming requests used

dify-agent meets neither. The official mitigation confirms: "Agent-level max_concurrency and non-streaming model requests are not affected."

Upgrading to 2.53.0 (the only patched version) introduces multiple breaking changes:

  • AgentStreamEvent schema uses oneOf discriminators that break FastAPI OpenAPI generation (2 test failures)
  • ModelResponse.state behavior on cancellation changed (1 test failure)
  • FunctionModel now requires function for non-streamed requests
  • AsyncHTTPClient type replaces httpx.AsyncClient in Provider._set_http_client

These require source and test changes that are out of scope for a dependency bump. The scan alert can be handled as a false positive / waiver since the vulnerable code path is not used.

@github-actions github-actions Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Oct 27, 2026
@xhdnoah
xhdnoah marked this pull request as ready for review October 27, 2026 09:43
@wylswz
wylswz added this pull request to the merge queue Oct 27, 2026
Merged via the queue into langgenius:main with commit 43c7f7b Oct 27, 2026
39 checks passed
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants