TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of `tf.ragged.constant` does not fully validate the input arguments. This results in a denial of service by consuming all available memory. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.
cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
D9359D32-D090-44CF-AC43-2046084A28BB
2.6.4
cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
C4DFBF2D-5283-42F6-8800-D653BFA5CE82
2.7.2
2.7.0
cpe:2.3:a:google:tensorflow:2.7.0:rc0:*:*:*:*:*:*
A58EDA5C-66D6-46F1-962E-60AFB7C784A7
cpe:2.3:a:google:tensorflow:2.7.0:rc1:*:*:*:*:*:*
89522760-C2DF-400D-9624-626D8F160CBA
cpe:2.3:a:google:tensorflow:2.8.0:-:*:*:*:*:*:*
E9EA1898-ACAA-4699-8BAE-54D62C1819FB
cpe:2.3:a:google:tensorflow:2.8.0:rc0:*:*:*:*:*:*
130DE3C9-6842-456F-A259-BF8FF8457217
cpe:2.3:a:google:tensorflow:2.8.0:rc1:*:*:*:*:*:*
BBF2FCEF-989C-409D-9F4C-81418C65B972
cpe:2.3:a:google:tensorflow:2.9.0:rc0:*:*:*:*:*:*
9CFB1CFC-579D-4647-A472-6DE8BE1951DE
cpe:2.3:a:google:tensorflow:2.9.0:rc1:*:*:*:*:*:*
F3F3F37E-D27F-4060-830C-0AFF16150777
OR
<em>Please make sure that this is a bug. As per our
[GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md),
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template</em>

**System information**
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): 
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary): 
- TensorFlow version (use command below):2.8.0
- Python version: 3.7.12
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: using a colab notebook
- GPU model and memory: using a colab notebook

You can collect some of this information using our environment capture
[script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh)
You can also obtain the TensorFlow version with:
1. TF 1.0: `python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"`
2. TF 2.0: `python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"`

**Describe the current behavior**

If I pass an empty list with a large ragged_rank to `tf.ragged.constant`,
all RAM is consumed, causing the notebook to crash.
The docs indicate that ragged_rank should be between 0 and the rank of pylist, so the large value of ragged_rank should be rejected

**Describe the expected behavior**

Some input validation should be done and an exception thrown.

**[Contributing](https://www.tensorflow.org/community/contribute)**

- Do you want to contribute a PR? (yes/no):
- Briefly describe your candidate solution(if contributing):

**Standalone code to reproduce the issue**
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.
The colab notebook:
https://colab.research.google.com/drive/1OyQNTCiqHKjmHKfYbSOmVt4EfkLEgsNA?usp=sharing

```
import tensorflow as tf
tf.ragged.constant(pylist=[],ragged_rank=8968073515812833920)
```

**Other info / logs** Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.

Missing input validation on `tf.ragged.constant`
This is a GitHub Issue
repo:tensorflow
owner:tensorflow
Title : Missing input validation on `tf.ragged.constant`
Issue date:

--- start body ---
<em>Please make sure that this is a bug. As per our
[GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md),
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template</em>

**System information**
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): 
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary): 
- TensorFlow version (use command below):2.8.0
- Python version: 3.7.12
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: using a colab notebook
- GPU model and memory: using a colab notebook

You can collect some of this information using our environment capture
[script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh)
You can also obtain the TensorFlow version with:
1. TF 1.0: `python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"`
2. TF 2.0: `python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"`

**Describe the current behavior**

If I pass an empty list with a large ragged_rank to `tf.ragged.constant`,
all RAM is consumed, causing the notebook to crash.
The docs indicate that ragged_rank should be between 0 and the rank of pylist, so the large value of ragged_rank should be rejected

**Describe the expected behavior**

Some input validation should be done and an exception thrown.

**[Contributing](https://www.tensorflow.org/community/contribute)**

- Do you want to contribute a PR? (yes/no):
- Briefly describe your candidate solution(if contributing):

**Standalone code to reproduce the issue**
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.
The colab notebook:
https://colab.research.google.com/drive/1OyQNTCiqHKjmHKfYbSOmVt4EfkLEgsNA?usp=sharing

```
import tensorflow as tf
tf.ragged.constant(pylist=[],ragged_rank=8968073515812833920)
```

**Other info / logs** Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.

--- end body ---

comments :
--- start comments ---

--- end comments ---