{"id":"CVE-2021-29534","published":"2021-05-14T19:11:57Z","modified":"2024-08-03T22:11:05Z","title":"CHECK-fail in SparseConcat","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.SparseConcat`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/b432a38fe0e1b4b904a6c222cbce794c39703e87/tensorflow/core/kernels/sparse_concat_op.cc#L76) takes the values specified in `shapes[0]` as dimensions for the output shape. The `TensorShape` constructor(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/framework/tensor_shape.cc#L183-L188) uses a `CHECK` operation which triggers when `InitDims`(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/framework/tensor_shape.cc#L212-L296) returns a non-OK status. This is a legacy implementation of the constructor and operations should use `BuildTensorShapeBase` or `AddDimWithStatus` to prevent `CHECK`-failures in the presence of overflows. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00189,"percentile":0.08718,"provenance":"source"},"cwes":[{"id":"CWE-754","name":"Improper Check for Unusual or Exceptional Conditions"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-6j9c-grc6-5m6g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/69c68ecbb24dff3fa0e46da0d16c821a2dd22d7c","tags":["x_refsource_MISC"]}],"priority":{"score":3.5,"factors":[{"name":"EPSS percentile","points":1.74},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.1.4",">= 2.2.0, < 2.2.3",">= 2.3.0, < 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-6j9c-grc6-5m6g","PYSEC-2021-171"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-6j9c-grc6-5m6g","PYSEC-2021-462"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-6j9c-grc6-5m6g","PYSEC-2021-660"],"provenance":"source"}],"summary":{"text":"A flaw in the SparseConcat operation of TensorFlow's core kernels (the tf.raw_ops.SparseConcat op) lets the output shape be derived directly from values in the shapes input without proper overflow checking, so a legacy TensorShape constructor hits a CHECK failure that aborts the process. An attacker who can get a local user or process to run TensorFlow code that calls this op with crafted shape values can crash the affected program, causing denial of service; the attack requires local access, low privileges, and a high-complexity condition, with no user interaction needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:08Z"},"euvd":{"id":"EUVD-2021-0275","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29523","children":[{"from":"CVE-2021-29534","to":"CVE-2022-23568","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/sparse_tensors_map_ops.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/69c68ecbb24dff3fa0e46da0d16c821a2dd22d7c","https://github.com/tensorflow/tensorflow/commit/a68f68061e263a88321c104a6c911fe5598050a8","https://github.com/tensorflow/tensorflow/commit/b51b82fe65ebace4475e3c54eb089c18a4403f1c"],"basis":"shared function","functions":["AddManySparseToTensorsMapOp"]}]}]}}