CVE-2020-26268: Write to immutable memory region in TensorFlow
(updated )
The tf.raw_ops.ImmutableConst
operation returns a constant tensor created from a memory mapped file which is assumed immutable. However, if the type of the tensor is not an integral type, the operation crashes the Python interpreter as it tries to write to the memory area:
>>> import tensorflow as tf
>>> with open('/tmp/test.txt','w') as f: f.write('a'*128)
>>> tf.raw_ops.ImmutableConst(dtype=tf.string,shape=2,
memory_region_name='/tmp/test.txt')
If the file is too small, TensorFlow properly returns an error as the memory area has fewer bytes than what is needed for the tensor it creates. However, as soon as there are enough bytes, the above snippet causes a segmentation fault.
References
- github.com/advisories/GHSA-hhvc-g5hv-48c6
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2020-299.yaml
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2020-334.yaml
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2020-255.yaml
- github.com/tensorflow/tensorflow
- github.com/tensorflow/tensorflow/commit/c1e1fc899ad5f8c725dcbb6470069890b5060bc7
- github.com/tensorflow/tensorflow/security/advisories/GHSA-hhvc-g5hv-48c6
- nvd.nist.gov/vuln/detail/CVE-2020-26268
Detect and mitigate CVE-2020-26268 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 →