CVE-2020-26267: TensorFlow - Unvalidated DataFormatVecPermute API

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2020-26267: Lack of validation in data format attributes in TensorFlow. Affects tensorflow across 5 version ranges.

< 1.15.5 >= 2.0.0, < 2.0.4 >= 2.1.0, < 2.1.3 >= 2.2.0, < 2.2.2 >= 2.3.0, < 2.3.2

Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2020-26267 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and community resources for building and deploying machine learning models. The tf.raw_ops.DataFormatVecPermute API is a function in TensorFlow that allows users to permute the data format of tensors. This API is used to manipulate the order of dimensions in a tensor, typically used for data preprocessing or model optimization. However, in certain versions of TensorFlow, the src_format and dst_format attributes of this API are not properly validated, leading to potential security vulnerabilities.

Vulnerability Detail

The vulnerability in TensorFlow's tf.raw_ops.DataFormatVecPermute API arises from the lack of validation for the src_format and dst_format attributes. The code assumes that these two arguments define a permutation of NHWC (representing the dimensions of a tensor: batch size, height, width, and channels). However, due to the absence of proper validation, it is possible to provide invalid or malicious values for these attributes. This can result in uninitialized memory accesses, reading outside of bounds, and even crashes. An attacker could exploit this vulnerability to execute arbitrary code, leak sensitive information, or cause denial-of-service attacks.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.15.5 1.15.5
  • >= 2.0.0, < 2.0.4 2.0.4
  • >= 2.1.0, < 2.1.3 2.1.3
  • >= 2.2.0, < 2.2.2 2.2.2
  • >= 2.3.0, < 2.3.2 2.3.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can avoid using the tf.raw_ops.DataFormatVecPermute API or ensure that the src_format and dst_format attributes are properly validated before calling the function. This can be done by implementing custom validation logic or using helper functions provided by the TensorFlow community. Here is an example of how to validate the attributes before calling the API:

import tensorflow as tf

def permute_data_format(src_format, dst_format):
    valid_formats = ['NHWC', 'NCHW', 'HWCN', 'CHWN']
    if src_format not in valid_formats or dst_format not in valid_formats:
        raise ValueError('Invalid data format')
    tf.raw_ops.DataFormatVecPermute(src_format=src_format, dst_format=dst_format)

Conclusion

In conclusion, the vulnerability in TensorFlow's tf.raw_ops.DataFormatVecPermute API can lead to serious security issues if not addressed. It is crucial to update TensorFlow to one of the fixed versions and follow the recommended upgrade instructions. Additionally, users can implement the provided workaround or custom validation logic to mitigate the risk. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework developed by Google. It provides tools and libraries for building and deploying machine learning models.

The tf.raw_ops.DataFormatVecPermute API is a function in TensorFlow that allows users to permute the data format of tensors, manipulating the order of dimensions.

This vulnerability can lead to uninitialized memory accesses, reading outside of bounds, and crashes. It can be exploited by attackers to execute arbitrary code, leak sensitive information, or cause denial-of-service attacks.

To fix this vulnerability, update TensorFlow to one of the fixed versions: 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2, or 2.4.0. Follow the official upgrade instructions provided by the TensorFlow project.

As a temporary workaround, avoid using the tf.raw_ops.DataFormatVecPermute API or ensure proper validation of the src_format and dst_format attributes before calling the function.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 1.15.5 1.15.5
  • >= 2.0.0, < 2.0.4 2.0.4
  • >= 2.1.0, < 2.1.3 2.1.3
  • >= 2.2.0, < 2.2.2 2.2.2
  • >= 2.3.0, < 2.3.2 2.3.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback