{"id":"CVE-2021-41202","published":"2021-11-05T21:45:18Z","modified":"2024-08-04T03:08:31Z","title":"Overflow/crash in `tf.range`","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an open source platform for machine learning. In affected versions while calculating the size of the output within the `tf.range` kernel, there is a conditional statement of type `int64 = condition ? int64 : double`. Due to C++ implicit conversion rules, both branches of the condition will be cast to `double` and the result would be truncated before the assignment. This result in overflows. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00209,"percentile":0.11282,"provenance":"source"},"cwes":[{"id":"CWE-681","name":"Incorrect Conversion between Numeric Types"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-xrqm-fpgr-6hhx","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/issues/46889","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/issues/46912","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/1b0e0ec27e7895b9985076eab32445026ae5ca94","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/6d94002a09711d297dbba90390d5482b76113899","tags":["x_refsource_MISC"]}],"priority":{"score":6.1,"factors":[{"name":"EPSS percentile","points":2.26},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.6.0, < 2.6.1",">= 2.5.0, < 2.5.2","< 2.4.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-xrqm-fpgr-6hhx","PYSEC-2021-395"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-xrqm-fpgr-6hhx","PYSEC-2021-612"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-xrqm-fpgr-6hhx","PYSEC-2021-810"],"provenance":"source"}],"summary":{"text":"The flaw is an integer overflow and resulting crash in the output-size calculation of the tf.range kernel in TensorFlow, caused by a conditional expression whose int64 and double branches are implicitly converted to double, truncating the result before assignment. An attacker with local access and low-privileged credentials, requiring no user interaction, can trigger the overflow to crash the affected process (a denial of service).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:18:01Z"},"euvd":{"id":"EUVD-2021-0425","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2020-15203","children":[{"from":"CVE-2021-41202","to":"CVE-2022-23562","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/sequence_ops.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/1b0e0ec27e7895b9985076eab32445026ae5ca94","https://github.com/tensorflow/tensorflow/commit/6d94002a09711d297dbba90390d5482b76113899","https://github.com/tensorflow/tensorflow/commit/f0147751fd5d2ff23251149ebad9af9f03010732"],"basis":"shared function","functions":["RangeOp"]}]}]}}