🇰🇷 한글 설명
TensorFlow의 `tf.raw_ops.BoostedTreesCreateEnsemble` 구현에서 특수하게 조작된 인자를 제공할 경우 Use-After-Free 오류가 발생할 수 있습니다. 리팩토링 과정에서 스마트 포인터와 참조 횟수 관리 로직이 충돌하여, 이미 해제된 리소스를 다시 해제하려는 이중 해제(Double-Free) 문제가 발생합니다.
💡 쉬운 설명
프로그램이 이미 사용이 끝나서 버린 메모리 공간을 실수로 다시 사용하거나 또 버리려고 시도하면서 발생하는 오류입니다. 공격자가 이를 악용하면 프로그램이 비정상적으로 종료되거나 시스템 제어권을 탈취할 위험이 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. In affected versions the implementation for `tf.raw_ops.BoostedTreesCreateEnsemble` can result in a use after free error if an attacker supplies specially crafted arguments. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/boosted_trees/resource_ops.cc#L55) uses a reference counted resource and decrements the refcount if the initialization fails, as it should. However, when the code was written, the resource was represented as a naked pointer but later refactoring has changed it to be a smart pointer. Thus, when the pointer leaves the scope, a subsequent `free`-ing of the resource occurs, but this fails to take into account that the refcount has already reached 0, thus the resource has been already freed. During this double-free process, members of the resource object are accessed for cleanup but they are invalid as the entire resource has been freed. We have patched the issue in GitHub commit 5ecec9c6fbdbc6be03295685190a45e7eee726ab. 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.BoostedTreesCreateEnsemble` 연산 실행
🛡️ 대응 방법
TensorFlow를 2.6.0 이상 버전으로 업데이트하거나, 지원되는 최신 패치 버전(2.5.1, 2.4.3, 2.3.4 등)으로 업그레이드하십시오.
🔧 검증 코드
출력된 버전 번호가 2.6.0 미만인지 확인하여 취약 여부를 판단합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'