Niska

Heap buffer overflow in `QuantizedReshape`

  • Ujawniono: 14.05.2021
  • Aktualizacja: 11.10.2026 13:19

Impact

An attacker can cause a heap buffer overflow in QuantizedReshape by passing in invalid thresholds for the quantization:

python
import tensorflow as tf

tensor = tf.constant([], dtype=tf.qint32)
shape = tf.constant([], dtype=tf.int32)
input_min = tf.constant([], dtype=tf.float32)
input_max = tf.constant([], dtype=tf.float32)

tf.raw_ops.QuantizedReshape(tensor=tensor, shape=shape, input_min=input_min, input_max=input_max)

This is because the implementation assumes that the 2 arguments are always valid scalars and tries to access the numeric value directly:

cc
const auto& input_min_float_tensor = ctx->input(2);
...
const float input_min_float = input_min_float_tensor.flat<float>()(0);
const auto& input_max_float_tensor = ctx->input(3);
...
const float input_max_float = input_max_float_tensor.flat<float>()(0);

However, if any of these tensors is empty, then .flat<T>() is an empty buffer and accessing the element at position 0 results in overflow.

Patches

We have patched the issue in GitHub commit a324ac84e573fba362a5e53d4e74d5de6729933e.

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 Ying Wang 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 2.5/10
Wektor CVSS
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L
Słabość (CWE)
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-173 - PyPA Advisory Database; CC BY 4.0

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

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

OSV / GitHub Advisory Database - GHSA-2gfx-95x2-5v3x - CC BY 4.0

Historia podatności: tensorflow-cpu

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

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

Rozkład istotności

  • Krytyczna 6
  • Wysoka 111
  • Średnia 208
  • Niska 105

Ujawnienia w latach

  1. 2019: 7
  2. 2020: 35
  3. 2021: 200
  4. 2022: 166
  5. 2023: 21
  6. 2024: 1
  7. 2025: 0
  8. 2026: 0
Istotność:
  1. Heap buffer overflow in `QuantizedReshape` ten wpis
    Niska · 2.5 CVE-2021-29536 < 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 118

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.