p PatchFirst

CVE-2025-12638

CVE-2025-12638 · Path Traversal Vulnerability in keras-team/keras via Tar Archive Extraction in keras.utils.get_file()

This page contains facts from public vulnerability sources. Check the original advisory before updating.

Keras version 3.11.3 is affected by a path traversal vulnerability in the keras.utils.get_file() function when extracting tar archives. The vulnerability arises because the function uses Python's tarfile.extractall() method without the security-critical filter='data' parameter. Although Keras attempts to filter unsafe paths using filter_safe_paths(), this filtering occurs before extraction, and a PATH_MAX symlink resolution bug triggers during extraction. This bug causes symlink resolution to fail due to path length limits, resulting in a security bypass that allows files to be written outside the intended extraction directory. This can lead to arbitrary file writes outside the cache directory, enabling potential system compromise or malicious code execution. The vulnerability affects Keras installations that process tar archives with get_file() and does not affect versions where this extraction method is secured with the appropriate filter parameter.

CVSS 8.0 · High · EPSS 0.7%

Published
Updated

Stack: system

Affected products and versions

  • keras-team/keras

    Versions
    • ≥ unspecified, ≤ latest: Affected (custom)

    No fix published

  • keras Debian:11

    Versions
    • 2.3.1+dfsg-3
    • 2.3.1+dfsg2-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • keras Ubuntu:18.04:LTS

    Versions
    • 1.0.7-2
    • 2.1.1-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

  • keras Ubuntu:20.04:LTS

    Versions
    • 2.2.4-1
    Affected ranges
    • ECOSYSTEM: (−∞, +∞)

    No fix published

Original sources

Check your server →