{"id":"CVE-2022-21733","published":"2022-02-03T11:28:10Z","modified":"2025-05-05T16:32:04Z","title":"Memory exhaustion in Tensorflow","vendor":null,"product":null,"tier":"tail","description":{"text":"Tensorflow is an Open Source Machine Learning Framework. The implementation of `StringNGrams` can be used to trigger a denial of service attack by causing an out of memory condition after an integer overflow. We are missing a validation on `pad_witdh` and that result in computing a negative value for `ngram_width` which is later used to allocate parts of the output. 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.00828,"percentile":0.58389,"provenance":"source"},"cwes":[{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-98j8-c9q4-r38g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/f68fdab93fb7f4ddb4eb438c8fe052753c9413e8","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/string_ngrams_op.cc#L29-L161","tags":["x_refsource_MISC"]}],"priority":{"score":14.7,"factors":[{"name":"EPSS percentile","points":11.68},{"name":"CVSS severity","points":3.01}]},"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-25T15:47:28.380553Z","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-98j8-c9q4-r38g","PYSEC-2026-3145"],"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-98j8-c9q4-r38g","PYSEC-2022-57"],"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-98j8-c9q4-r38g","PYSEC-2022-112"],"provenance":"source"}],"summary":{"text":"The flaw is an integer overflow in TensorFlow's implementation of StringNGrams, caused by missing validation on pad_witdh, which produces a negative ngram_width used to allocate parts of the output. An attacker with low-privilege access over the network, requiring no user interaction, can trigger an out-of-memory condition that causes a denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:39:31Z"},"euvd":{"id":"EUVD-2022-0296","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2020-15205","parents":[{"from":"CVE-2020-15205","to":"CVE-2022-21733","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/string_ngrams_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/0462de5b544ed4731aa2fb23946ac22c01856b80","https://github.com/tensorflow/tensorflow/commit/f68fdab93fb7f4ddb4eb438c8fe052753c9413e8"],"basis":"shared function","functions":["StringNGramsOp"]}]},{"from":"CVE-2021-29541","to":"CVE-2022-21733","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/string_ngrams_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/ba424dd8f16f7110eea526a8086f1a155f14f22b","https://github.com/tensorflow/tensorflow/commit/f68fdab93fb7f4ddb4eb438c8fe052753c9413e8"],"basis":"shared function","functions":["StringNGramsOp"]}]},{"from":"CVE-2021-29542","to":"CVE-2022-21733","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/string_ngrams_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/ba424dd8f16f7110eea526a8086f1a155f14f22b","https://github.com/tensorflow/tensorflow/commit/f68fdab93fb7f4ddb4eb438c8fe052753c9413e8"],"basis":"shared function","functions":["StringNGramsOp"]}]},{"from":"CVE-2021-37646","to":"CVE-2022-21733","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/string_ngrams_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/c283e542a3f422420cfdb332414543b62fc4e4a5","https://github.com/tensorflow/tensorflow/commit/f68fdab93fb7f4ddb4eb438c8fe052753c9413e8"],"basis":"shared function","functions":["StringNGramsOp"]}]}]}}