Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXZxMnItNXh2bS0zaGMz
Segfault in `CTCBeamSearchDecoder`
Impact
Due to lack of validation in tf.raw_ops.CTCBeamSearchDecoder
, an attacker can trigger denial of service via segmentation faults:
import tensorflow as tf
inputs = tf.constant([], shape=[18, 8, 0], dtype=tf.float32)
sequence_length = tf.constant([11, -43, -92, 11, -89, -83, -35, -100],
shape=[8], dtype=tf.int32)
beam_width = 10
top_paths = 3
merge_repeated = True
tf.raw_ops.CTCBeamSearchDecoder(
inputs=inputs, sequence_length=sequence_length, beam_width=beam_width,
top_paths=top_paths, merge_repeated=merge_repeated)
The implementation fails to detect cases when the input tensor is empty and proceeds to read data from a null buffer.
Patches
We have patched the issue in GitHub commit b1b323042264740c398140da32e93fb9c2c9f33e.
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.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
Attribution
This vulnerability has been reported by Yakun Zhang and Ying Wang of Baidu X-Team.
Permalink: https://github.com/advisories/GHSA-vq2r-5xvm-3hc3JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXZxMnItNXh2bS0zaGMz
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Low
Classification: General
Published: about 2 years ago
Updated: 4 months ago
CVSS Score: 2.5
CVSS vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L
Identifiers: GHSA-vq2r-5xvm-3hc3, CVE-2021-29581
References:
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-vq2r-5xvm-3hc3
- https://nvd.nist.gov/vuln/detail/CVE-2021-29581
- https://github.com/tensorflow/tensorflow/commit/b1b323042264740c398140da32e93fb9c2c9f33e
- https://github.com/advisories/GHSA-vq2r-5xvm-3hc3
Affected Packages
pypi:tensorflow-gpu
Versions: >= 2.4.0, < 2.4.2, >= 2.3.0, < 2.3.3, >= 2.2.0, < 2.2.3, < 2.1.4Fixed in: 2.4.2, 2.3.3, 2.2.3, 2.1.4
pypi:tensorflow-cpu
Versions: >= 2.4.0, < 2.4.2, >= 2.3.0, < 2.3.3, >= 2.2.0, < 2.2.3, < 2.1.4Fixed in: 2.4.2, 2.3.3, 2.2.3, 2.1.4
pypi:tensorflow
Versions: >= 2.4.0, < 2.4.2, >= 2.3.0, < 2.3.3, >= 2.2.0, < 2.2.3, < 2.1.4Fixed in: 2.4.2, 2.3.3, 2.2.3, 2.1.4