🇰🇷 한글 설명
TensorFlow의 `tf.raw_ops.SaveV2` 코드에서 입력값 검증이 제대로 이루어지지 않아 Null 포인터 역참조가 발생할 수 있는 취약점입니다. `ValidateInputs` 함수가 오류를 감지하더라도 실행 흐름이 중단되지 않고 계속 진행되어 검증을 우회하게 됩니다. 이로 인해 공격자가 시스템의 비정상적인 동작을 유도할 수 있습니다.
💡 쉬운 설명
프로그램이 데이터를 저장할 때 잘못된 값이 들어왔는지 확인하는 과정에서 오류가 발생해도 그냥 무시하고 다음 단계를 진행하는 문제입니다. 이 때문에 잘못된 데이터가 처리되면서 프로그램이 갑자기 멈추거나 오류를 일으킬 수 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. In affected versions the code for `tf.raw_ops.SaveV2` does not properly validate the inputs and an attacker can trigger a null pointer dereference. The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/save_restore_v2_ops.cc) uses `ValidateInputs` to check that the input arguments are valid. This validation would have caught the illegal state represented by the reproducer above. However, the validation uses `OP_REQUIRES` which translates to setting the `Status` object of the current `OpKernelContext` to an error status, followed by an empty `return` statement which just terminates the execution of the function it is present in. However, this does not mean that the kernel execution is finalized: instead, execution continues from the next line in `Compute` that follows the call to `ValidateInputs`. This is equivalent to lacking the validation. We have patched the issue in GitHub commit 9728c60e136912a12d99ca56e106b7cce7af5986. 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 포함)
⚔️ 공격 벡터
조작된 입력값을 포함한 TensorFlow 연산 실행을 통한 Null 포인터 역참조 유도
🛡️ 대응 방법
TensorFlow를 2.6.0 이상 버전으로 업데이트하거나 보안 패치가 적용된 최신 마이너 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 2.6.0 미만인지 확인하여 취약 여부를 판단합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'