Skip to content

Fix high-severity model and image loading vulnerabilities - #626

Draft
peter-matkovski wants to merge 1 commit into
mainfrom
agent/fix-model-loading-vulnerabilities
Draft

Fix high-severity model and image loading vulnerabilities#626
peter-matkovski wants to merge 1 commit into
mainfrom
agent/fix-model-loading-vulnerabilities

Conversation

@peter-matkovski

@peter-matkovski peter-matkovski commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require patched ONNX, Transformers, and Pillow releases across the workspace
  • update Hugging Face Hub constraints needed by Transformers 5
  • regenerate the uv workspace lock

Risk

The affected plugins load configurable Hugging Face model repositories and process caller-supplied images. Those are the model-deserialization and image-processing entry points covered by the open advisories, so these alerts are reachable rather than lockfile-only findings.

Addresses the current high-severity ONNX, Transformers, and Pillow Dependabot alerts, including GHSA-fgcw and the ONNX parser advisories.

Validation

  • uv lock --check
  • git diff --check

Full model integration tests require downloading large model artifacts and are left to CI.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated dependency constraints across the core package and three plugins. Pillow now requires version 12.3.x. Transformers now requires version 5.5.x in the affected plugins. Hugging Face Hub now requires version 1.5.x. The root uv configuration now overrides NumPy, ONNX, Pillow, and Transformers versions.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8df70f24-c649-4036-bfd0-26b18191f987

📥 Commits

Reviewing files that changed from the base of the PR and between 7b5084c and 5bd32f0.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • agents-core/pyproject.toml
  • plugins/huggingface/pyproject.toml
  • plugins/moondream/pyproject.toml
  • plugins/smart_turn/pyproject.toml
  • pyproject.toml

"av>=14.2.0, <17",
"python-dotenv>=1.1.1",
"pillow>=10.4.0",
"pillow>=12.3.0,<13",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== tracked files close to pyproject =="
git ls-files | rg '(^|/)pyproject\.toml$|moondream|agents-core'

echo
echo "== agents-core/pyproject.toml =="
cat -n agents-core/pyproject.toml

echo
echo "== dependencies mentioning moondream/pillow =="
rg -n "moondream|Pillow|pillow" -S --glob '!*.lock' --glob '!**/.venv/**' --glob '!**/dist/**' --glob '!**/build/**' .

echo
echo "== diff/stat if available =="
git diff --stat || true
git diff -- agents-core/pyproject.toml || true

Repository: GetStream/Vision-Agents

Length of output: 31060


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== root pyproject relevant sections =="
rg -n "vision-agents-plugins-moondream|pillow|python-dotenv|tool\\.uv|\\[tool\\.uv" pyproject.toml
sed -n '1,120p' pyproject.toml

echo
echo "== moondream pyproject and README dependency refs =="
cat -n plugins/moondream/pyproject.toml
sed -n '300,326p' plugins/moondream/README.md

echo
echo "== direct moondream API usage of Pillow/PIL in source =="
rg -n "Image\\.|PIL|Pillow|pillow|open\\(|annotate_detections|save\\(" plugins/moondream/vision_agents plugins/moondream/tests -S
sed -n '230,330p' plugins/moondream/vision_agents/plugins/moondream/detection/moondream_cloud_processor.py
sed -n '140,230p' plugins/moondream/vision_agents/plugins/moondream/detection/moondream_local_processor.py
sed -n '1,80p' plugins/moondream/vision_agents/plugins/moondream/moondream_utils.py

echo
echo "== tests expecting errors / compatibility notes =="
rg -n "pillow|Pillow|version|12\\.|1[01]|<11|>=10" plugins/moondream tests examples -S

Repository: GetStream/Vision-Agents

Length of output: 50381


🌐 Web query:

Pillow 12.3.0 Release Notes breaking changes

💡 Result:

Pillow 12.3.0, released on July 1, 2026, includes several security and functional updates that involve changes to existing behaviors, which may impact applications relying on previous versions [1][2]. While the release notes do not use the explicit label "breaking changes," the following modifications constitute significant shifts in behavior: 1. Decompression Bomb Protection: - PdfStream.decode: A default maximum of ImageFile.SAFEBLOCK has been added to limit data decompression when parsing PDFs, which could potentially cause issues for processes handling extremely large PDF streams [1][3]. - GdImageFile: A decompression bomb check has been added to PIL.GdImageFile, which must now be explicitly handled [3][4]. - FontFile: Decompression bomb checks have been added to FontFile and its subclasses, validating the width and height of characters [1][3]. 2. Validation Changes: - EPS Parsing: The BeginBinary byte count in EPS images is now validated to prevent potential infinite loops caused by negative byte counts [3][4]. 3. Removed Support: - Python 3.13 Free-Threaded Wheels: Support for Python 3.13 free-threaded wheels has been removed, following the official release of Python 3.14 [3][4]. 4. New API Parameters: - ImageGrab.grab: Now accepts an optional scale_down keyword argument, which defaults to False (capturing Retina screenshots at 2x) [3][4]. - PdfStream.decode: Now accepts an optional max_length argument to specify the maximum amount of data to decode [1][3]. Users are encouraged to review these changes, particularly if their workflows involve complex PDF/EPS parsing or specific Python build environments [1][3].

Citations:


🌐 Web query:

Pillow 12 major version changelog changes removing deprecated APIs

💡 Result:

Pillow 12.0.0 was released on October 15, 2025, and included a significant number of removals of previously deprecated APIs [1][2][3]. Key removals in this major version include: - Python Support: Dropped support for Python 3.9 [4][1]. - ImageFile APIs: ImageFile.raise_oserror() was removed as it was an undocumented helper function whose functionality is now handled automatically [4][5]. - IptcImageFile Helpers: The functions IptcImageFile.dump and IptcImageFile.i, along with the constant IptcImageFile.PAD, were removed [4][5]. - ImageMath: ImageMath.eval() was removed; users should use lambda_eval() or unsafe_eval() instead [5]. - ImageCms: Removed various constants and a function related to LittleCMS version 1, as well as the use of non-Pillow image modes in ImageCms [5]. - Library Support: Dropped support for FreeType versions 2.9.0 and earlier, and LibTIFF versions earlier than 4 [6][5]. - Drawing and Coordinate APIs: The hints parameter in ImageDraw.getdraw() was removed [6][5]. Additionally, various coordinate processing APIs (such as those in ImagePath.Path, polygon(), and line()) were hardened against heap buffer overflows caused by nested lists [7]. - Other Removals: Numerous internal helper functions and constants were removed, including Image.isImageType(), ImageMath.lambda_eval and ImageMath.unsafe_eval options parameters, ImageFile.h, and various internal pointer and legacy API helpers [6]. For a complete list of deprecated and removed features, you can refer to the official Pillow documentation [6][2].

Citations:


Verify Moondream compatibility before allowing Pillow 12.x.

agents-core requires pillow>=12.3.0,<13, and the Moondream plugin now mirrors that workspace constraint even though its docs still list pillow>=10.0.0. Add/enable Moondream annotation integration tests against Pillow 12.3.0, or restore the previous working cap until those tests pass.

Source: Learnings

@Nash0x7E2

Copy link
Copy Markdown
Member

@peter-matkovski - can you take a look at the CR and CI?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants