CVE-2021-29529
Description
TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a heap buffer overflow in `tf.raw_ops.QuantizedResizeBilinear` by manipulating input values so that float rounding results in off-by-one error in accessing image elements. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/44b7f486c0143f68b56c34e2d01e146ee445134a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc#L62-L66) computes two integers (representing the upper and lower bounds for interpolation) by ceiling and flooring a floating point value. For some values of `in`, `interpolation->upper[i]` might be smaller than `interpolation->lower[i]`. This is an issue if `interpolation->upper[i]` is capped at `in_size-1` as it means that `interpolation->lower[i]` points outside of the image. Then, in the interpolation code(https://github.com/tensorflow/tensorflow/blob/44b7f486c0143f68b56c34e2d01e146ee445134a/tensorflow/core/kernels/quantized_resize_bilinear_op.cc#L245-L264), this would result in heap buffer overflow. 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.
Weakness
- CWE-131: Incorrect Calculation of Buffer Size
Timeline
- 2021-05-14Published by the CNA19:12 UTC
- 2021-05-21GitHub advisory published (GHSA-jfp7-4j67-8r3q)7 days after publication
Exploit and advisory records
GitHub advisory GHSA-jfp7-4j67-8r3q, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI tensorflow | before 2.1.4 | 2.1.4 |
| PyPI tensorflow | from 2.2.0 before 2.2.3 | 2.2.3 |
| PyPI tensorflow | from 2.3.0 before 2.3.3 | 2.3.3 |
| PyPI tensorflow | from 2.4.0 before 2.4.2 | 2.4.2 |
| PyPI tensorflow-cpu | before 2.1.4 | 2.1.4 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| google tensorflow | before 2.1.4fixed in 2.1.4from 2.2.0 before 2.2.3fixed in 2.2.3from 2.3.0 before 2.3.3fixed in 2.3.3from 2.4.0 before 2.4.2fixed in 2.4.2 | 2.1.42.2.32.3.32.4.2 |
References
- https://github.com/tensorflow/tensorflow/commit/f851613f8f0fb0c838d160ced13c134f778e3ce7
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-jfp7-4j67-8r3q
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2021-29529'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2021-29529'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2021-29529'curl 'https://api.contrastcyber.com/cve_products/CVE-2021-29529'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).