{"id":"CVE-2022-23585","published":"2022-02-04T22:32:27Z","modified":"2025-04-22T18:24:37Z","title":"Memory leak in decoding PNG images in Tensorflow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01,"percentile":0.63644,"provenance":"source"},"cwes":[{"id":"CWE-401","name":"Missing Release of Memory after Effective Lifetime"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-fq6p-6334-8gr4","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/ab51e5b813573dc9f51efa335aebcf2994125ee9","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/kernels/image/decode_image_op.cc#L322-L416","tags":["x_refsource_MISC"]}],"priority":{"score":15.7,"factors":[{"name":"EPSS percentile","points":12.73},{"name":"CVSS severity","points":3.01}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.5.3",">= 2.6.0, < 2.6.3",">= 2.7.0, < 2.7.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-22T15:50:17.637283Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.5.3",">=2.6.0, <2.6.3",">=2.7.0, <2.7.1"],"patched":["2.5.3","2.6.3","2.7.1"],"from":["GHSA-fq6p-6334-8gr4","PYSEC-2026-3174"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.5.3",">=2.6.0, <2.6.3",">=2.7.0, <2.7.1"],"patched":["2.5.3","2.6.3","2.7.1"],"from":["GHSA-fq6p-6334-8gr4","PYSEC-2022-94"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.5.3",">=2.6.0, <2.6.3",">=2.7.0, <2.7.1"],"patched":["2.5.3","2.6.3","2.7.1"],"from":["GHSA-fq6p-6334-8gr4","PYSEC-2022-149"],"provenance":"source"}],"summary":{"text":"A memory leak in TensorFlow's PNG image decoding code (the png::CommonInitDecode path) occurs when an invalid image triggers an error case that exits early, so buffers allocated during decoding are never freed. An attacker who can get the framework to decode a crafted PNG file, which requires low-privileged access and no user interaction over the network, can exhaust memory over repeated decodes, causing a denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:32:44Z"},"euvd":{"id":"EUVD-2022-0333","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2018-7576","parents":[{"from":"CVE-2022-23584","to":"CVE-2022-23585","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/image/decode_image_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/e746adbfcfee15e9cfdb391ff746c765b99bdf9b","https://github.com/tensorflow/tensorflow/commit/ab51e5b813573dc9f51efa335aebcf2994125ee9"],"basis":"shared function","functions":["DecodeImageV2Op"]}]}],"children":[{"from":"CVE-2022-23585","to":"CVE-2023-25667","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/image/decode_image_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/ab51e5b813573dc9f51efa335aebcf2994125ee9","https://github.com/tensorflow/tensorflow/commit/8dc723fcdd1a6127d6c970bd2ecb18b019a1a58d"],"basis":"shared function","functions":["DecodeImageV2Op"]}]}]}}