Junglewise Threat Intelligence

CVE-2024-55459: Keras path traversal in get_file function

CVE-2024-55459 · Severity: medium · CVSS 4 · Published 2025-01-08

Technologies: Keras Team Keras. Vendors: PyPI.

Executive brief

Keras, a popular deep learning library, contains a vulnerability in its file-handling utility. An attacker can provide a specially crafted archive file that, when downloaded and processed by the library, writes files to unintended locations on the user's computer. This could allow an attacker to overwrite sensitive system files or configuration data, potentially compromising the integrity of the machine.

Technical details

A path traversal vulnerability exists in the `get_file` function within `keras/src/utils/file_utils.py` of Keras versions up to and including 3.7.0. The issue arises when the function downloads and extracts a crafted tar archive that contains filenames with path traversal sequences (e.g., ../). Because the extraction process does not sufficiently validate the destination paths, an attacker can achieve arbitrary file writes on the local filesystem. Exploitation requires a user to be tricked into downloading a malicious file via the affected function. As of the advisory date, no official patch has been confirmed in the provided documentation.

Affected products

  • Keras Team keras <= 3.7.0

Timeline

  • 2025-01-08: disclosed
  • 2025-01-08: advisory

References

Related threats