← Back to Pull requests

fix(security): ship pillow 13.0.0 in aiperf-bench, drop pillow VEX #3516

Closed
unknown closed this pull request without merging on Oct 30, 2026 22:58 UTC
View on GitHub
unknown unknown commented on Oct 29, 2026 21:16 UTC
Author

Summary

The aiperf-bench image now ships pillow 13.0.0 instead of 12.3.0, which removes all 28 HIGH+ pillow advisories from the image instead of suppressing them. The 28 pillow OpenVEX statements are retired, so .openvex.json goes back to "statements": [].

Motivation / Context

aiperf 0.13.0 (the newest release) pins pillow~=12.3.0, and every one of these advisories is fixed only in pillow 13.0.0, so no aiperf bump reaches the fix. #3492 hid them with not_affected statements. This PR removes them.

This is a stopgap until upstream releases. The proper fix is ai-dynamo/aiperf#1630, which moves aiperf itself to pillow~=13.0.0. It's still open and unreleased, and we're waiting on an aiperf release that includes it. When that ships, a follow-up bumps aiperf in requirements.txt (and AIPERF_VERSION), deletes the pillow line from requirements-overrides.txt, and reruns make python-licenses.

Fixes: N/A
Related: #3515 (stays open until an inference-perf run and the first post-merge release scan confirm pillow is gone)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundler and deployers (pkg/bundler, pkg/component)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: aiperf-bench image (validators/performance), notices/source tooling (tools/generate-*), OpenVEX
  • Implementation Notes

  • Why a second input file. pip cannot install a version outside a dependency's declared range, so pillow cannot simply be pinned in requirements.txt. The new validators/performance/requirements-overrides.txt holds pillow==13.0.0, and the Dockerfile installs it with pip install --no-deps right after the main install, in the same RUN as the pip uninstall.

  • The three tools that read requirements.txt now read the overrides file too, so they keep describing what actually ships:

  • - tools/generate-python-licenses downloads the overrides with --no-deps and gives them precedence. The attribution therefore records pillow 13.0.0, not 12.3.0. With --wheels-dir, override wheels come from an overrides/ subdirectory.
    - tools/generate-aiperf-source resolves the overrides with --no-deps and swaps them into the closure, so the source referrer publishes pillow 13.0.0's sdist.
    - tools/generate-notices and TestCommittedFragmentMatchesRequirements check the overrides file's sha256 as well as requirements.txt's. Editing either one without running make python-licenses fails closed, and the merge-gate path filter now watches the new file.
  • Fail-closed guard. Both generators reject an override that names a package the resolved closure doesn't contain. An override with --no-deps must replace a version, never add a package, because the added package's own dependencies would never be installed. The license tool also warns when an override is redundant.

  • Compatibility. aiperf 0.13.0 calls only Image.open/new/fromarray (without mode), resize(Image.LANCZOS), tobytes, registered_extensions and ImageDraw. None of the APIs pillow 13.0.0 removed are used: Image._show, Image.Image.get_child_images, ExifTags.IFD.Makernote, the ImageCms product fields, and I-mode PNG clipping.

  • Fragment drift. The regenerated python-notices.md also moves about 50 transitive packages to their current releases. That's the existing unpinned-closure behavior (#2086): every image rebuild already resolves those versions. The only override is pillow 12.3.0 → 13.0.0. The package count is unchanged at 138.

  • Renovate. Its default pip_requirements file pattern already matches requirements-overrides.txt, so pillow patch releases will get bump PRs. RENOVATE.md now lists the file.

  • VEX.

  • - The document moves to version 25 with no statements.
    - The pillow-13-blocked-by-aiperf-pin known-negative in vex-state.yaml is deleted, because overriding the range is exactly what it said had not been tried.
    - A deferred verification is added for the first weekly scan on main after this merges.
  • Removal. The header of the overrides file says to delete the entry once an aiperf release admits pillow>=13.
  • Testing

    make qualify   # passes, run with the .settings.yaml-pinned yq, helm, oasdiff and apidiff on PATH
    

  • Built aiperf-bench locally for linux/amd64 (docker buildx build --platform linux/amd64 -f validators/performance/aiperf-bench.Dockerfile):

  • - The image has pillow 13.0.0 and aiperf 0.13.0. aiperf --version and aiperf profile --help run, and pip is still absent from the runtime.
    - aiperf's pillow-using modules import cleanly (aiperf.dataset.utils, aiperf.dataset.generator.image, aiperf.dataset.generator.video).
    - Every pillow call aiperf makes works on pillow 13: fromarray, ImageDraw, LANCZOS resize, tobytes, and a PNG/JPEG save-and-reopen round trip.
  • Scanned that image with grype 0.116.1 using the CI flags (--only-fixed -c .grype.yaml) and no VEX file. Main's image has 28 pillow critical/high findings, and this PR's image has none, with no pillow match at any severity. syft catalogs pillow 13.0.0. What remains is 1 critical (CVE-2026-115557) and 3 mediums, all in CPython 3.13.16 from the distroless base and present on main too. That critical is new in the 2026-10-30 DB and needs a base with Python 3.13.18, handled separately. The before/after comparison and raw output are in the test evidence comment below.

  • make python-licenses resolved 138 packages and logged override pillow: 12.3.0 -> 13.0.0. tools/generate-aiperf-source's read_closure() against live PyPI returned the same 138 packages with ('pillow', '13.0.0').

  • New and updated tests in tests/notices:

  • - override precedence and an override outside the closure, for both generators;
    - stale-fragment rejection when only the overrides file changed;
    - the committed-fragment hash check for both inputs.

    The generate-notices staleness tests ran against the real go-licenses.

  • Coverage: no non-test Go source changed.
  • Not done yet: an inference-perf UAT run on the rebuilt image. The weekly scan on main is tracked as a deferred verification in vex-state.yaml.

    Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

  • Medium — Touches multiple components or has broader impact

  • High — Breaking change, affects critical paths, or complex rollout
  • Rollout notes: The image runs aiperf against a pillow major version that aiperf doesn't declare support for. AICR's invocation (aiperf profile --endpoint-type chat, text-only) never reaches pillow, and the APIs aiperf does call were exercised in the built image. If anything regresses, reverting this PR restores pillow 12.3.0 and the VEX statements. N/A otherwise.

    Checklist

  • Tests pass locally (make test with -race)

  • Linter passes (make lint)

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed

  • Changes follow existing patterns in the codebase

  • Commits are signed off and cryptographically signed (git commit -s -S) — GPG signing info
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: yuanchen8911 Review duration: 1542m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #3516"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.7% · Safe to merge
    29.7%
    Repository