{"id":"CVE-2021-29518","published":"2021-05-14T19:36:06Z","modified":"2024-08-03T22:11:05Z","title":"Session operations in eager mode lead to null pointer dereferences","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. In eager mode (default in TF 2.0 and later), session operations are invalid. However, users could still call the raw ops associated with them and trigger a null pointer dereference. The implementation(https://github.com/tensorflow/tensorflow/blob/eebb96c2830d48597d055d247c0e9aebaea94cd5/tensorflow/core/kernels/session_ops.cc#L104) dereferences the session state pointer without checking if it is valid. Thus, in eager mode, `ctx->session_state()` is nullptr and the call of the member function is undefined behavior. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00201,"percentile":0.05696,"provenance":"source"},"cwes":[{"id":"CWE-476","name":"NULL Pointer Dereference"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-62gx-355r-9fhg","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/ff70c47a396ef1e3cb73c90513da4f5cb71bebba","tags":["x_refsource_MISC"]}],"priority":{"score":2.9,"factors":[{"name":"EPSS percentile","points":1.14},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.1.4",">= 2.2.0, < 2.2.3",">= 2.3.0, < 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-62gx-355r-9fhg","PYSEC-2021-155"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-62gx-355r-9fhg","PYSEC-2021-446"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-62gx-355r-9fhg","PYSEC-2021-644"],"provenance":"source"}],"summary":{"text":"The TensorFlow flaw is a null pointer dereference in the session operations component (session_ops.cc) of the tensorflow product: in eager mode, calling the raw session ops dereferences the session state pointer without checking it, which is undefined behavior. An attacker with local access and low privileges, who can invoke those raw ops, can trigger the crash, with high attack complexity and no user interaction required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:22:49Z"},"euvd":{"id":"EUVD-2021-0259","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-29518","children":[{"from":"CVE-2021-29518","to":"CVE-2022-29191","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/session_ops.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/ff70c47a396ef1e3cb73c90513da4f5cb71bebba","https://github.com/tensorflow/tensorflow/commit/48305e8ffe5246d67570b64096a96f8e315a7281"],"basis":"shared function","functions":["GetSessionTensorOp"]}]},{"from":"CVE-2021-29518","to":"CVE-2022-29194","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/session_ops.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/ff70c47a396ef1e3cb73c90513da4f5cb71bebba","https://github.com/tensorflow/tensorflow/commit/cff267650c6a1b266e4b4500f69fbc49cdd773c5"],"basis":"shared function","functions":["DeleteSessionTensorOp"]}]}]}}