Cherry-pick #18311 to 3.0-dev: Patch keras for CVE-2026-12480 (supersedes #17925 revert) - #18418
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Toolio Iglesias🗺️] Cherry-picking PR #18311 from
fasttrack/3.0to bring the CVE-2026-12480 keras patch back into3.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 tensorflowphase with:Root cause: #17925 added
from keras.src.utils.module_utils import h5pyat the top ofkeras/src/saving/saving_lib.py, but never declaredh5pyinsidemodule_utils.py. That symbol only existed if the underlying h5py package was importable, and the tensorflow container's.pipelines/containerSourceData/tensorflow/tensorflow.pkgdoesn't requestpython3-h5py— so everyimport tensorflowblew 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")LazyModuleresolves the real package only when a method/attribute is accessed, soimport tf.kerassucceeds even in containers that don't havepython3-h5pyinstalled. No new package deps required.Validation
fasttrack/3.0on 2026-08-07 as PR [Medium] Patch keras for CVE-2026-12480 #18311.Test tensorflowphase = succeeded on both arches.python3-keras-3.3.3-8.azl3+python3-h5py-3.10.0-2.azl3installed cleanly from PMC.Refs