PT-2026-59827 · Pypi · Tensorflow

Published

2026-07-13

·

Updated

2026-07-13

CVSS v3.1

5.9

Medium

VectorAV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Impact

When [mlir::tfg::ConvertGenericFunctionToFunctionDef](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/ir/importexport/functiondef import.cc) is given empty function attributes, it crashes.
cpp
// We pre-allocate the array of operands and populate it using the
// `output name to position` and `control output to position` populated
// previously.
SmallVector<Value> ret vals(func.ret size() + func.control ret size(),
              Value());
for (const auto& ret val : func.ret()) {
 auto position = output name to position.find(ret val.first);
 if (position == output name to position.end())
  return InvalidArgument(
    "Can't import function, returned value references unknown output "
    "argument ",
    ret val.first);
 ret vals[position->second] =
   value manager.GetValueOrCreatePlaceholder(ret val.second);
}
for (const auto& ret val : func.control ret()) {
 auto position = control output to position.find(ret val.first);
 if (position == control output to position.end())
  return InvalidArgument(
    "Can't import function, returned value references unknown output "
    "argument ",
    ret val.first);
 Value result = value manager.GetValueOrCreatePlaceholder(
   (Twine("^") + ret val.second).str());
ret val.second cannot be empty. Neither can input.
cpp
// Process every node and create a matching MLIR operation
for (const NodeDef& node : nodes) {
 if (node.op().empty()) return InvalidArgument("empty op type");
 OperationState state(unknown loc, absl::StrCat("tfg.", node.op()));
 // Fetch the inputs, creating placeholder if an input hasn't been visited.
 for (const std::string& input : node.input())
  state.operands.push back(
    value manager.GetValueOrCreatePlaceholder(input));

Patches

We have patched the issue in GitHub commit ad069af92392efee1418c48ff561fd3070a03d7b.
The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, 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.

Fix

Found an issue in the description? Have something to add? Feel free to write us 👾

Related Identifiers

PYSEC-2026-3210

Affected Products

Tensorflow