Niska

Heap buffer overflow in `BandedTriangularSolve`

  • Ujawniono: 14.05.2021
  • Aktualizacja: 11.10.2026 13:19

Impact

An attacker can trigger a heap buffer overflow in Eigen implementation of tf.raw_ops.BandedTriangularSolve:

python
import tensorflow as tf
import numpy as np
  
matrix_array = np.array([])
matrix_tensor = tf.convert_to_tensor(np.reshape(matrix_array,(0,1)),dtype=tf.float32)
rhs_array = np.array([1,1])
rhs_tensor = tf.convert_to_tensor(np.reshape(rhs_array,(1,2)),dtype=tf.float32)
tf.raw_ops.BandedTriangularSolve(matrix=matrix_tensor,rhs=rhs_tensor)

The implementation calls ValidateInputTensors for input validation but fails to validate that the two tensors are not empty:

cc
void ValidateInputTensors(OpKernelContext* ctx, const Tensor& in0, const Tensor& in1) {
  OP_REQUIRES(
      ctx, in0.dims() >= 2, 
      errors::InvalidArgument("In[0] ndims must be >= 2: ", in0.dims()));

  OP_REQUIRES(
      ctx, in1.dims() >= 2,
      errors::InvalidArgument("In[1] ndims must be >= 2: ", in1.dims()));
}

Furthermore, since OP_REQUIRES macro only stops execution of current function after setting ctx->status() to a non-OK value, callers of helper functions that use OP_REQUIRES must check value of ctx->status() before continuing. This doesn't happen in this op's implementation, hence the validation that is present is also not effective.

Patches

We have patched the issue in GitHub commit ba6822bd7b7324ba201a28b2f278c29a98edbef2 followed by GitHub commit 0ab290774f91a23bebe30a358fde4e53ab4876a0.

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 Ye Zhang and Yakun Zhang of Baidu X-Team.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) tensorflow < 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2 2.1.4, 2.2.3, 2.3.3, 2.4.2
Python (PyPI) tensorflow-cpu < 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2 2.1.4, 2.2.3, 2.3.3, 2.4.2
Python (PyPI) tensorflow-gpu < 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2 2.1.4, 2.2.3, 2.3.3, 2.4.2

Odnośniki

Ocena CVSS 3.6/10
Wektor CVSS
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
Słabość (CWE)
CWE-120, CWE-787
Platforma
Python (PyPI)
Paczka
tensorflow, tensorflow-cpu, tensorflow-gpu
Ujawniono
14.05.2021
Aktualizacja
11.10.2026 13:19

Źródła i licencje

OSV / GitHub Advisory Database - PYSEC-2021-249 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2021-540 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2021-738 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-2xgj-xhgf-ggjv - CC BY 4.0

Historia podatności: tensorflow

Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (433) w archiwum
Wszystkich wpisów
433
Pierwsza → ostatnia
04.2019 07.2024
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 6
  • Wysoka 112
  • Średnia 210
  • Niska 105

Ujawnienia w latach

  1. 2019: 7
  2. 2020: 35
  3. 2021: 200
  4. 2022: 169
  5. 2023: 21
  6. 2024: 1
  7. 2025: 0
  8. 2026: 0
Istotność:
  1. Heap buffer overflow in `BandedTriangularSolve` ten wpis
    Niska · 3.6 CVE-2021-29612 < 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2 2.1.4, 2.2.3, 2.3.3, 2.4.2
  2. Wysoka · 7.5 CVE-2023-33976 < 2.12.1 2.12.1
  3. Wysoka · 7.5 CVE-2023-25659 < 2.11.1 2.11.1
  4. Wysoka · 7.5 CVE-2023-25660 < 2.11.1 2.11.1
  5. Wysoka · 7.5 CVE-2023-25662 < 2.11.1 2.11.1
  6. Wysoka · 7.5 CVE-2023-25663 < 2.11.1 2.11.1
  7. Wysoka · 7.5 CVE-2023-25664 < 2.11.1 2.11.1
  8. Wysoka · 7.5 CVE-2023-25665 < 2.11.1 2.11.1
  9. Wysoka · 7.5 CVE-2023-25666 < 2.11.1 2.11.1
  10. Wysoka · 7.5 CVE-2023-25669 < 2.11.1 2.11.1
  11. Wysoka · 7.5 CVE-2023-25671 < 2.11.1 2.11.1
  12. Wysoka · 7.5 CVE-2023-25672 < 2.11.1 2.11.1
  13. Wysoka · 7.5 CVE-2023-25673 < 2.11.1 2.11.1
  14. Wysoka · 7.5 CVE-2023-25674 < 2.11.1 2.11.1
  15. Wysoka · 7.5 CVE-2023-25675 < 2.11.1 2.11.1
  16. Wysoka · 7.5 CVE-2023-25676 < 2.11.1 2.11.1
  17. Wysoka · 8.0 CVE-2023-25801 < 2.11.1 2.11.1
  18. Wysoka · 7.5 CVE-2023-27579 < 2.11.1 2.11.1
  19. Wysoka · 7.5 CVE-2023-25658 < 2.11.1 2.11.1
Pokaż więcej (20) Widać 21 z 119

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.