Skip to content
OpenAdvisories
Medium · 4.3 CVE-2022-23585 BIT-tensorflow-2022-23585EUVD-2022-0333GHSA-fq6p-6334-8gr4PYSEC-2022-149PYSEC-2022-94PYSEC-2026-3174

Memory leak in decoding PNG images in Tensorflow

Published Feb 4, 2022 · Updated Apr 22, 2025 · Assigned by GitHub_M

Description

Tensorflow is an Open Source Machine Learning Framework. When decoding PNG images TensorFlow can produce a memory leak if the image is invalid. After calling `png::CommonInitDecode(..., &decode)`, the `decode` value contains allocated buffers which can only be freed by calling `png::CommonFreeDecode(&decode)`. However, several error case in the function implementation invoke the `OP_REQUIRES` macro which immediately terminates the execution of the function, without allowing for the memory free to occur. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Affected products

VendorProductAffectedFixed
tensorflow tensorflow < 2.5.3, >= 2.6.0, < 2.6.3, >= 2.7.0, < 2.7.1 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI tensorflow < 2.5.3 2.5.3 GHSA-fq6p-6334-8gr4
PyPI tensorflow >= 2.6.0, < 2.6.3 2.6.3 GHSA-fq6p-6334-8gr4
PyPI tensorflow >= 2.7.0, < 2.7.1 2.7.1 GHSA-fq6p-6334-8gr4
PyPI tensorflow < 2.5.3 · >= 2.6.0, < 2.6.3 · >= 2.7.0, < 2.7.1 2.5.3, 2.6.3, 2.7.1 PYSEC-2026-3174
PyPI tensorflow-cpu < 2.5.3 2.5.3 GHSA-fq6p-6334-8gr4
PyPI tensorflow-cpu >= 2.6.0, < 2.6.3 2.6.3 GHSA-fq6p-6334-8gr4
PyPI tensorflow-cpu >= 2.7.0, < 2.7.1 2.7.1 GHSA-fq6p-6334-8gr4
PyPI tensorflow-cpu < 2.5.3 · >= 2.6.0, < 2.6.3 2.5.3, 2.6.3 PYSEC-2022-94
PyPI tensorflow-gpu < 2.5.3 2.5.3 GHSA-fq6p-6334-8gr4
PyPI tensorflow-gpu >= 2.6.0, < 2.6.3 2.6.3 GHSA-fq6p-6334-8gr4
PyPI tensorflow-gpu >= 2.7.0, < 2.7.1 2.7.1 GHSA-fq6p-6334-8gr4
PyPI tensorflow-gpu < 2.5.3 · >= 2.6.0, < 2.6.3 2.5.3, 2.6.3 PYSEC-2022-149

References