{"id":"CVE-2021-37671","published":"2021-08-12T21:40:22Z","modified":"2024-08-04T01:23:01Z","title":"Reference binding to nullptr in map operations in TensorFlow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can cause undefined behavior via binding a reference to null pointer in `tf.raw_ops.Map*` and `tf.raw_ops.OrderedMap*` operations. The [implementation](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/core/kernels/map_stage_op.cc#L222-L248) has a check in place to ensure that `indices` is in ascending order, but does not check that `indices` is not empty. We have patched the issue in GitHub commit 532f5c5a547126c634fefd43bbad1dc6417678ac. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00173,"percentile":0.07,"provenance":"source"},"cwes":[{"id":"CWE-824","name":"Access of Uninitialized Pointer"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-qr82-2c78-4m8h","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/532f5c5a547126c634fefd43bbad1dc6417678ac","tags":["x_refsource_MISC"]}],"priority":{"score":6.9,"factors":[{"name":"EPSS percentile","points":1.4},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.5.0, < 2.5.1",">= 2.4.0, < 2.4.3","< 2.3.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-qr82-2c78-4m8h","PYSEC-2021-293"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-qr82-2c78-4m8h","PYSEC-2021-584"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-qr82-2c78-4m8h","PYSEC-2021-782"],"provenance":"source"}],"summary":{"text":"The flaw is in TensorFlow's Map and OrderedMap operations (tf.raw_ops.Map* and tf.raw_ops.OrderedMap*), where a reference is bound to a null pointer because the code checks that indices are in ascending order but never checks that the indices list is non-empty. An attacker with local access and low privileges, with no user interaction needed, can trigger undefined behavior by submitting an empty indices input to these operations.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:14:02Z"},"euvd":{"id":"EUVD-2021-0397","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-37671","children":[{"from":"CVE-2021-37671","to":"CVE-2021-37673","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/map_stage_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/532f5c5a547126c634fefd43bbad1dc6417678ac","https://github.com/tensorflow/tensorflow/commit/d7de67733925de196ec8863a33445b73f9562d1d"],"basis":"rarely changed file"}]},{"from":"CVE-2021-37671","to":"CVE-2022-21734","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/map_stage_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/532f5c5a547126c634fefd43bbad1dc6417678ac","https://github.com/tensorflow/tensorflow/commit/f57315566d7094f322b784947093406c2aea0d7d"],"basis":"rarely changed file"}]}]}}