TensorFlow is an open source platform for machine learning. In affected versions the shape inference function for `Transpose` is vulnerable to a heap buffer overflow. This occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid. 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.
{"id": "OSV:PYSEC-2021-625", "vendorId": null, "type": "osv", "bulletinFamily": "software", "title": "PYSEC-2021-625", "description": "TensorFlow is an open source platform for machine learning. In affected versions the shape inference function for `Transpose` is vulnerable to a heap buffer overflow. This occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid. 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.", "published": "2021-11-05T23:15:00", "modified": "2021-12-09T06:35:09", "cvss": {"score": 4.6, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:P"}, "cvss2": {"cvssV2": {"version": "2.0", "vectorString": "AV:L/AC:L/Au:N/C:P/I:P/A:P", "accessVector": "LOCAL", "accessComplexity": "LOW", "authentication": "NONE", "confidentialityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "baseScore": 4.6}, "severity": "MEDIUM", "exploitabilityScore": 3.9, "impactScore": 6.4, "acInsufInfo": false, "obtainAllPrivilege": false, "obtainUserPrivilege": false, "obtainOtherPrivilege": false, "userInteractionRequired": false}, "cvss3": {"cvssV3": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH", "baseScore": 7.8, "baseSeverity": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}, "href": "https://osv.dev/vulnerability/PYSEC-2021-625", "reporter": "Google", "references": ["https://github.com/tensorflow/tensorflow/security/advisories/GHSA-3ff2-r28g-w7h9", "https://github.com/tensorflow/tensorflow/commit/c79ba87153ee343401dbe9d1954d7f79e521eb14"], "cvelist": ["CVE-2021-41216"], "immutableFields": [], "lastseen": "2022-05-11T21:30:15", "viewCount": 2, "enchantments": {"dependencies": {}, "score": {"value": 2.3, "vector": "NONE"}, "backreferences": {"references": [{"type": "github", "idList": ["GHSA-3FF2-R28G-W7H9"]}]}, "exploitation": null, "vulnersScore": 2.3}, "_state": {"dependencies": 0}, "_internal": {}, "affectedSoftware": [{"version": "1.15.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.1.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.1.1", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.1.2", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.1.3", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.1.4", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.2.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.2.1", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.2.2", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.2.3", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.3.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.3.1", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.3.2", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.3.3", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.3.4", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.4.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.4.1", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.4.2", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.4.3", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.5.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.5.1", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.6.0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.7.0rc0", "operator": "eq", "name": "tensorflow-cpu"}, {"version": "2.7.0rc1", "operator": "eq", "name": "tensorflow-cpu"}]}
{"osv": [{"lastseen": "2022-05-11T21:33:16", "description": "TensorFlow is an open source platform for machine learning. In affected versions the shape inference function for `Transpose` is vulnerable to a heap buffer overflow. This occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid. 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.", "cvss3": {"exploitabilityScore": 1.8, "cvssV3": {"baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "LOCAL", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "baseScore": 7.8, "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2021-11-05T23:15:00", "type": "osv", "title": "PYSEC-2021-408", "bulletinFamily": "software", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 3.9, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 4.6, "vectorString": "AV:L/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 6.4, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2021-41216"], "modified": "2021-11-13T06:52:44", "id": "OSV:PYSEC-2021-408", "href": "https://osv.dev/vulnerability/PYSEC-2021-408", "cvss": {"score": 4.6, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:P"}}, {"lastseen": "2022-06-10T04:56:48", "description": "### Impact\nThe [shape inference function for `Transpose`](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/ops/array_ops.cc#L121-L185) is vulnerable to a heap buffer overflow:\n\n```python\nimport tensorflow as tf\n@tf.function\ndef test():\n y = tf.raw_ops.Transpose(x=[1,2,3,4],perm=[-10])\n return y\n\ntest()\n```\n\nThis occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid:\n \n```cc\nfor (int32_t i = 0; i < rank; ++i) {\n int64_t in_idx = data[i];\n if (in_idx >= rank) {\n return errors::InvalidArgument(\"perm dim \", in_idx,\n \" is out of range of input rank \", rank);\n }\n dims[i] = c->Dim(input, in_idx);\n}\n```\n\nwhere `Dim(tensor, index)` accepts either a positive index less than the rank of the tensor or the special value `-1` for unknown dimensions.\n\n### Patches\nWe have patched the issue in GitHub commit [c79ba87153ee343401dbe9d1954d7f79e521eb14](https://github.com/tensorflow/tensorflow/commit/c79ba87153ee343401dbe9d1954d7f79e521eb14).\n\nThe 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.\n\n### For more information\nPlease consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.\n\n### Attribution\nThis vulnerability has been reported by members of the Aivul Team from Qihoo 360.", "cvss3": {"exploitabilityScore": 1.8, "cvssV3": {"baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "LOCAL", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "baseScore": 7.8, "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2021-11-10T18:57:19", "type": "osv", "title": "Heap buffer overflow in `Transpose`", "bulletinFamily": "software", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 3.9, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 4.6, "vectorString": "AV:L/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 6.4, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2021-41216"], "modified": "2022-06-10T02:20:53", "id": "OSV:GHSA-3FF2-R28G-W7H9", "href": "https://osv.dev/vulnerability/GHSA-3ff2-r28g-w7h9", "cvss": {"score": 4.6, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:P"}}, {"lastseen": "2022-05-11T21:28:38", "description": "TensorFlow is an open source platform for machine learning. In affected versions the shape inference function for `Transpose` is vulnerable to a heap buffer overflow. This occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid. 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.", "cvss3": {"exploitabilityScore": 1.8, "cvssV3": {"baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "LOCAL", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "baseScore": 7.8, "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2021-11-05T23:15:00", "type": "osv", "title": "PYSEC-2021-823", "bulletinFamily": "software", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 3.9, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 4.6, "vectorString": "AV:L/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 6.4, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2021-41216"], "modified": "2021-12-09T06:35:43", "id": "OSV:PYSEC-2021-823", "href": "https://osv.dev/vulnerability/PYSEC-2021-823", "cvss": {"score": 4.6, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:P"}}], "cve": [{"lastseen": "2022-03-23T19:14:57", "description": "TensorFlow is an open source platform for machine learning. In affected versions the shape inference function for `Transpose` is vulnerable to a heap buffer overflow. This occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid. 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.", "cvss3": {"exploitabilityScore": 1.8, "cvssV3": {"baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "LOCAL", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "baseScore": 7.8, "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2021-11-05T23:15:00", "type": "cve", "title": "CVE-2021-41216", "cwe": ["CWE-787"], "bulletinFamily": "NVD", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 3.9, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 4.6, "vectorString": "AV:L/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 6.4, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2021-41216"], "modified": "2021-11-09T15:53:00", "cpe": ["cpe:/a:google:tensorflow:2.7.0"], "id": "CVE-2021-41216", "href": "https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-41216", "cvss": {"score": 4.6, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:P"}, "cpe23": ["cpe:2.3:a:google:tensorflow:2.7.0:rc1:*:*:*:*:*:*", "cpe:2.3:a:google:tensorflow:2.7.0:rc0:*:*:*:*:*:*"]}], "github": [{"lastseen": "2022-04-15T14:32:16", "description": "### Impact\nThe [shape inference function for `Transpose`](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/ops/array_ops.cc#L121-L185) is vulnerable to a heap buffer overflow:\n\n```python\nimport tensorflow as tf\n@tf.function\ndef test():\n y = tf.raw_ops.Transpose(x=[1,2,3,4],perm=[-10])\n return y\n\ntest()\n```\n\nThis occurs whenever `perm` contains negative elements. The shape inference function does not validate that the indices in `perm` are all valid:\n \n```cc\nfor (int32_t i = 0; i < rank; ++i) {\n int64_t in_idx = data[i];\n if (in_idx >= rank) {\n return errors::InvalidArgument(\"perm dim \", in_idx,\n \" is out of range of input rank \", rank);\n }\n dims[i] = c->Dim(input, in_idx);\n}\n```\n\nwhere `Dim(tensor, index)` accepts either a positive index less than the rank of the tensor or the special value `-1` for unknown dimensions.\n\n### Patches\nWe have patched the issue in GitHub commit [c79ba87153ee343401dbe9d1954d7f79e521eb14](https://github.com/tensorflow/tensorflow/commit/c79ba87153ee343401dbe9d1954d7f79e521eb14).\n\nThe 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.\n\n### For more information\nPlease consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.\n\n### Attribution\nThis vulnerability has been reported by members of the Aivul Team from Qihoo 360.", "cvss3": {"exploitabilityScore": 1.8, "cvssV3": {"baseSeverity": "HIGH", "confidentialityImpact": "HIGH", "attackComplexity": "LOW", "scope": "UNCHANGED", "attackVector": "LOCAL", "availabilityImpact": "HIGH", "integrityImpact": "HIGH", "privilegesRequired": "LOW", "baseScore": 7.8, "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H", "version": "3.1", "userInteraction": "NONE"}, "impactScore": 5.9}, "published": "2021-11-10T18:57:19", "type": "github", "title": "Heap buffer overflow in `Transpose`", "bulletinFamily": "software", "cvss2": {"severity": "MEDIUM", "exploitabilityScore": 3.9, "obtainAllPrivilege": false, "userInteractionRequired": false, "obtainOtherPrivilege": false, "cvssV2": {"accessComplexity": "LOW", "confidentialityImpact": "PARTIAL", "availabilityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "baseScore": 4.6, "vectorString": "AV:L/AC:L/Au:N/C:P/I:P/A:P", "version": "2.0", "accessVector": "LOCAL", "authentication": "NONE"}, "impactScore": 6.4, "acInsufInfo": false, "obtainUserPrivilege": false}, "cvelist": ["CVE-2021-41216"], "modified": "2021-11-10T18:57:19", "id": "GHSA-3FF2-R28G-W7H9", "href": "https://github.com/advisories/GHSA-3ff2-r28g-w7h9", "cvss": {"score": 4.6, "vector": "AV:L/AC:L/Au:N/C:P/I:P/A:P"}}]}