Skip to content

[AutoPR- Security] Patch keras for CVE-2026-12480 [MEDIUM]#17925

Open
azurelinux-security wants to merge 1 commit into
microsoft:3.0-devfrom
azurelinux-security:azure-autosec/keras/3.0/1154419
Open

[AutoPR- Security] Patch keras for CVE-2026-12480 [MEDIUM]#17925
azurelinux-security wants to merge 1 commit into
microsoft:3.0-devfrom
azurelinux-security:azure-autosec/keras/3.0/1154419

Conversation

@azurelinux-security

@azurelinux-security azurelinux-security commented Jul 6, 2026

Copy link
Copy Markdown

Auto Patch keras for CVE-2026-12480.

Autosec pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=1154419&view=results

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?

Change Log
Does this affect the toolchain?

YES/NO

Associated issues
  • N/A
Links to CVEs
Test Methodology

@Ratiranjan5

Ratiranjan5 commented Jul 8, 2026

Copy link
Copy Markdown

CVE-2026-12480:

  1. The keras package version 3.3.3 falls within the affected range for CVE-2026-12480 (all versions prior to 3.12.2 / 3.14.1). The vulnerable code is present in keras-3.3.3.

  2. Upstream patch (d5a88bdb) backported by AI.
    Below are the differences between the AI backport and upstream. The security fix is identical in both patches. Both add the check if dataset.is_virtual: raise ValueError(...) inside safe_get_h5_dataset() to reject virtual datasets.

  • Our 3.3.3 has both H5IOStore and a helper class H5Entry, where H5Entry is the one that actually reads the HDF5 datasets. Upstream doesn't have H5Entry, that logic was folded into class H5IOStore. So, in the AI backport, the safe_get_h5_dataset check and the _verify_* removal go into H5Entry where the read happens in 3.3.3, while upstream applies the same fix in H5IOStore.

  • In our 3.3.3, the function load_weights_from_hdf5_group takes (f, model) and has no skip_mismatch parameter, while upstream's version is (group, model, skip_mismatch=False). So the backport keeps the 3.3.3 signature instead of copying upstream's. Another function load_weights_from_hdf5_group_by_name matches in both (it already has skip_mismatch=False).

  • file_editor.py is omitted. This file doesn't exist in Keras 3.3.3. The only change upstream made to it was swapping how h5py is imported, which has nothing to do with the security fix.

  1. Patch applied cleanly.

  2. Buddy Build passed on amd64 but failed on arm64, which is expected as the spec defines ExclusiveArch: x86_64.

@Kanishk-Bansal Kanishk-Bansal marked this pull request as ready for review July 8, 2026 14:36
@Kanishk-Bansal Kanishk-Bansal requested a review from a team as a code owner July 8, 2026 14:36
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.

3 participants