Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-29608

TensorFlow is an end-to-end open source platform for machine learning. Due to lack of validation in `tf.raw_ops.RaggedTensorToTensor`, an attacker can exploit an undefined behavior if input arguments are empty. The implementation(https://github.com/tensorflow/tensorflow/blob/656e7673b14acd7835dc778867f84916c6d1cac2/tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc#L356-L360) only checks that one of the tensors is not empty, but does not check for the other ones. There are multiple `DCHECK` validations to prevent heap OOB, but these are no-op in release builds, hence they don't prevent anything. The fix will be included in TensorFlow 2.5.0. We will also cherrypick these commits 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-29608
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:45 UTC · Revision 1

Source evidence

CVE-2021-29608

core-osv · Original source

Published 14 May 2021, 20:15 UTC

TensorFlow is an end-to-end open source platform for machine learning. Due to lack of validation in `tf.raw_ops.RaggedTensorToTensor`, an attacker can exploit an undefined behavior if input arguments are empty. The implementation(https://github.com/tensorflow/tensorflow/blob/656e7673b14acd7835dc778867f84916c6d1cac2/tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc#L356-L360) only checks that one of the tensors is not empty, but does not check for the other ones. There are multiple `DCHECK` validations to prevent heap OOB, but these are no-op in release builds, hence they don't prevent anything. The fix will be included in TensorFlow 2.5.0. We will also cherrypick these commits 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.

osv:CVE-2021-29608
Complete source record
{
  "id": "74106d680c4774478ae10bd75b4b4f8deca39f0ddb2eab2fc5852e3061d52c70",
  "url": "https://osv.dev/vulnerability/CVE-2021-29608",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-29608",
    "summary": "TensorFlow is an end-to-end open source platform for machine learning. Due to lack of validation in `tf.raw_ops.RaggedTensorToTensor`, an attacker can exploit an undefined behavior if input arguments are empty. The implementation(https://github.com/tensorflow/tensorflow/blob/656e7673b14acd7835dc778867f84916c6d1cac2/tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc#L356-L360) only checks that one of the tensors is not empty, but does not check for the other ones. There are multiple `DCHECK` validations to prevent heap OOB, but these are no-op in release builds, hence they don't prevent anything. The fix will be included in TensorFlow 2.5.0. We will also cherrypick these commits 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.",
    "evidence": "osv:CVE-2021-29608",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-29608",
      "aliases": [
        "BIT-tensorflow-2021-29608",
        "CVE-2021-29608",
        "GHSA-rgvq-pcvf-hx75",
        "PYSEC-2021-245",
        "PYSEC-2021-536",
        "PYSEC-2021-734"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/tensorflow/tensorflow",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "0931ea3d985bb9c8fdd054a5e29c4129623c849b"
                },
                {
                  "introduced": "2b96f3662bd776e277f86997659e61046b56c315"
                },
                {
                  "fixed": "cfe0c80169ae984bcdc99ff6de7444164aaa8e07"
                },
                {
                  "introduced": "b36436b087bd8e8701ef51718179037cccdfc26e"
                },
                {
                  "fixed": "3929ffacfbef7c431e8397920d040aaf47acff19"
                },
                {
                  "introduced": "582c8d236cb079023657287c318ff26adb239002"
                },
                {
                  "fixed": "1923123d32ea41d92b70a27a3f6ecf0763b56f6c"
                },
                {
                  "fixed": "b761c9b652af2107cfbc33efd19be0ce41daa33e"
                },
                {
                  "fixed": "c4d7afb6a5986b04505aca4466ae1951686c80f6"
                },
                {
                  "fixed": "f94ef358bb3e91d517446454edff6535bcfe8e4a"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.1.4"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.2.0"
                      },
                      {
                        "fixed": "2.2.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.3.0"
                      },
                      {
                        "fixed": "2.3.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.4.0"
                      },
                      {
                        "fixed": "2.4.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "b761c9b652af2107cfbc33efd19be0ce41daa33e"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c4d7afb6a5986b04505aca4466ae1951686c80f6"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "f94ef358bb3e91d517446454edff6535bcfe8e4a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v2.1.3",
            "v2.2.2",
            "v2.3.2",
            "v2.4.1",
            "v2.1.2",
            "v2.2.1",
            "v2.4.0",
            "v2.3.1",
            "v2.2.0",
            "v2.1.1",
            "v2.3.0",
            "v2.1.0",
            "v2.1.0-rc0",
            "v2.1.0-rc2",
            "v2.1.0-rc1",
            "v1.12.1",
            "v1.9.0-rc2",
            "v1.6.0-rc1",
            "v1.1.0-rc2",
            "v1.1.0-rc1",
            "0.6.0",
            "0.5.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-29608.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-29608-68d9f390",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "249125983411237778077357819018283228101",
                    "224225715799553139835089081014822499096",
                    "89771992617694012861121810825654946439",
                    "57697706386363761551520552450951936154",
                    "173116402065283144941021544294863588812",
                    "47679337683675975583932308822958650277",
                    "11144949190430349860178379568497870552",
                    "245805652595465449079994929785890654734",
                    "102425096751956106258985037720504503995",
                    "159668403106193831194856579617896296892",
                    "38183220989813737365513727035477222180",
                    "156156706975795986934815005834390715502",
                    "147586881926638651756449299782912906449",
                    "209356590531167267085439812288600526337",
                    "70918752554432641803879867457934640029",
                    "135301078357798866027025190198850196994",
                    "1186475045450812353824322895200941531",
                    "134223807494517121514473982267299999601",
                    "204775446420127901152275085876230632212",
                    "105811780005781227693434087604319227862",
                    "270305002660176484138203960881787944840",
                    "130598382842540853021323520735610211888",
                    "16482891946551912352838656644856888937",
                    "97860040454334985656194126645928942115",
                    "200102702869818704062871055169725428057",
                    "142156975901606492553589811250991478621"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/b761c9b652af2107cfbc33efd19be0ce41daa33e",
                "target": {
                  "file": "tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-29608-9bac07fd",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "297848537437013270431059876612001787558",
                    "209681301969152117928165261862015457299",
                    "166018209318291324224501329322710774118",
                    "73482831109764674259720641944552373336",
                    "27829288452007872853762420861852460277",
                    "106835929023457931786732367699317880640",
                    "6170122786494338025413087051610846381",
                    "209921729186114257279926686470157071191",
                    "224037023355246668888069852437447355832",
                    "143122612808373158215428658515677481382",
                    "208559248787608483064716825123230289655",
                    "284939494610827365467037861468405145678",
                    "162402071281529480883019592886079948349",
                    "228444824470354092738758439020461505727",
                    "318261652120323461120165933659214545662",
                    "43728872660346604508597650386298090804",
                    "2410389750711933446027924866544607793",
                    "109415049946756972115994067483475735808",
                    "178981221351963592004832868886109842047",
                    "168846703144013571935572356498424677041",
                    "172833242916951617559730043353388337492",
                    "39982722071425773069656052018268020487",
                    "36144556323819937496649629866213117733",
                    "253723389608850802510055038890953831334",
                    "122464976018273334746325188826498386399",
                    "88757261466386833301521360041645675700",
                    "118712825691397195963095850034550967286",
                    "234532927204328953692114402209992425125",
                    "216770770446997022275815671259044096045",
                    "224754537680135727871139823445875427033",
                    "22934318445214743126769322219963062661",
                    "89791954598453925584347864246076726025",
                    "25287365442537521955879595358581124724",
                    "63978234852089265650844513113367784760",
                    "59566876241232561795442073805754572044",
                    "74914138686874437372339074698021476789",
                    "42283856558767351283720524026229941230",
                    "27337476825836754657814942664668922929",
                    "228598926067598159407557501040402032925",
                    "233200548681517801024212818062840620493",
                    "239197063647377325490780138600411303115",
                    "107396893034794526068403721316550754540",
                    "84365614028170489622265723408093974108",
                    "196176944167035235536574678998364004967",
                    "60275375074503957235107538518761234206",
                    "67131772162783293626026510912418085555",
                    "281529616106781670239324493612351330249",
                    "193402570767729763037094442176266763239",
                    "283946892745834898735418364879067586178",
                    "140468828843151079230033846747535869948"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/c4d7afb6a5986b04505aca4466ae1951686c80f6",
                "target": {
                  "file": "tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-29608-c2ba6324",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "167043840453157900431467451878395386366",
                    "278994113256611250724258513999170603783",
                    "183963932834839107604429801913804307147",
                    "322451706284865770715113899046288408491"
                  ]
                },
                "source": "https://github.com/tensorflow/tensorflow/commit/f94ef358bb3e91d517446454edff6535bcfe8e4a",
                "target": {
                  "file": "tensorflow/core/kernels/ragged_tensor_to_tensor_op.cc"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:24:45Z"
          }
        }
      ],
      "modified": "2026-10-20T14:24:45.042746727Z",
      "provider": "osv",
      "references": [
        "https://github.com/tensorflow/tensorflow/commit/b761c9b652af2107cfbc33efd19be0ce41daa33e",
        "https://github.com/tensorflow/tensorflow/commit/c4d7afb6a5986b04505aca4466ae1951686c80f6",
        "https://github.com/tensorflow/tensorflow/commit/f94ef358bb3e91d517446454edff6535bcfe8e4a",
        "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-rgvq-pcvf-hx75"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-29608",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 388963,
  "published_at": "2021-05-14T20:15:15.803+00:00"
}