🔍 CVE-2021-37646

5.5
CVSS Score
MEDIUM
2021-08-12
2026-06-17 04:00
✅ 완료

🇰🇷 한글 설명

TensorFlow의 `tf.raw_ops.StringNGrams` 구현에서 정수 오버플로 취약점이 발견되었습니다. 사용자가 음수의 `ngram_widths`를 입력할 경우, 부호 있는 정수가 부호 없는 정수로 변환되면서 매우 큰 메모리 할당을 시도하게 됩니다. 이로 인해 메모리 손상이나 서비스 거부(DoS)가 발생할 수 있습니다.

💡 쉬운 설명

머신러닝 도구인 TensorFlow에서 숫자를 처리할 때 계산 오류가 발생하는 문제입니다. 공격자가 특수한 음수 값을 입력하면 컴퓨터가 감당할 수 없는 엄청난 양의 메모리를 사용하려고 시도하여 프로그램이 멈출 수 있습니다.

🇺🇸 원문 (English)

TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation of `tf.raw_ops.StringNGrams` is vulnerable to an integer overflow issue caused by converting a signed integer value to an unsigned one and then allocating memory based on this value. The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/string_ngrams_op.cc#L184) calls `reserve` on a `tstring` with a value that sometimes can be negative if user supplies negative `ngram_widths`. The `reserve` method calls `TF_TString_Reserve` which has an `unsigned long` argument for the size of the buffer. Hence, the implicit conversion transforms the negative value to a large integer. We have patched the issue in GitHub commit c283e542a3f422420cfdb332414543b62fc4e4a5. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

📍 영향받는 시스템

TensorFlow 2.6.0 미만 버전 (2.5.1, 2.4.3, 2.3.4 포함)

⚔️ 공격 벡터

사용자 입력값이 포함된 `tf.raw_ops.StringNGrams` 연산 실행을 통한 정수 오버플로 유도

🛡️ 대응 방법

TensorFlow를 2.6.0 이상 버전으로 업데이트하거나, 패치가 적용된 2.5.1, 2.4.3, 2.3.4 버전으로 업데이트하십시오.

🔧 검증 코드

출력된 버전 번호가 2.6.0 미만인지 확인하여 취약 여부를 판단합니다.

Shell / Script
python3 -c 'import tensorflow as tf; print(tf.__version__)'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

Azure Machine Learning