Skip to content

Cherry-pick #18311 to 3.0-dev: Patch keras for CVE-2026-12480 (supersedes #17925 revert) - #18418

Merged
jslobodzian merged 1 commit into
3.0-devfrom
jslobo/cp-pr-18311-to-3.0-dev
Aug 14, 2026
Merged

Cherry-pick #18311 to 3.0-dev: Patch keras for CVE-2026-12480 (supersedes #17925 revert)#18418
jslobodzian merged 1 commit into
3.0-devfrom
jslobo/cp-pr-18311-to-3.0-dev

Conversation

@jslobodzian

Copy link
Copy Markdown
Collaborator

[Toolio Iglesias🗺️] Cherry-picking PR #18311 from fasttrack/3.0 to bring the CVE-2026-12480 keras patch back into 3.0-dev.

Why this is safe now (unlike #17925)

PR #17925 originally patched CVE-2026-12480 on 3.0-dev on 2026-07-13 and was reverted by #18286 on 2026-08-01 because it broke the AMD64 DEV golden container Test tensorflow phase with:

ImportError: cannot import name 'h5py' from 'keras.src.utils.module_utils'

Root cause: #17925 added from keras.src.utils.module_utils import h5py at the top of keras/src/saving/saving_lib.py, but never declared h5py inside module_utils.py. That symbol only existed if the underlying h5py package was importable, and the tensorflow container's .pipelines/containerSourceData/tensorflow/tensorflow.pkg doesn't request python3-h5py — so every import tensorflow blew up.

What's different in #18311

PR #18311 is the actual upstream keras fix (keras-team/keras#22801 by hertschuh), not the AllSpark AI-generated backport used in #17925. It touches a third file — keras/src/utils/module_utils.py:

 scipy = LazyModule("scipy")
 jax = LazyModule("jax")
+h5py = LazyModule("h5py")
 optree = LazyModule("optree")

LazyModule resolves the real package only when a method/attribute is accessed, so import tf.keras succeeds even in containers that don't have python3-h5py installed. No new package deps required.

Validation

  • The fix landed on fasttrack/3.0 on 2026-08-07 as PR [Medium] Patch keras for CVE-2026-12480 #18311.
  • Downstream Golden Container tests on 2026-08-11 (builds 1180168 AMD64 / 1180041 ARM64) succeeded, with Test tensorflow phase = succeeded on both arches.
  • Container SBOM confirms python3-keras-3.3.3-8.azl3 + python3-h5py-3.10.0-2.azl3 installed cleanly from PMC.

Refs

@jslobodzian
jslobodzian requested a review from a team as a code owner August 13, 2026 21:31
@microsoft-github-policy-service microsoft-github-policy-service Bot added Packaging 3.0-dev PRs Destined for AzureLinux 3.0 labels Aug 13, 2026
@jslobodzian
jslobodzian merged commit 3d36e7f into 3.0-dev Aug 14, 2026
26 of 28 checks passed
@jslobodzian
jslobodzian deleted the jslobo/cp-pr-18311-to-3.0-dev branch August 14, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0-dev PRs Destined for AzureLinux 3.0 Packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants