{"id":"CVE-2022-35939","summary":"Out of bounds write in `scatter_nd` op in TensorFlow Lite","details":"TensorFlow is an open source platform for machine learning. The `ScatterNd` function takes an input argument that determines the indices of of the output tensor. An input index greater than the output tensor or less than zero will either write content at the wrong index or trigger a crash. We have patched the issue in GitHub commit b4d4b4cb019bd7240a52daa4ba61e3cc814f0384. 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. There are no known workarounds for this issue.","aliases":["BIT-tensorflow-2022-35939","GHSA-ffjm-4qwc-7cmf","PYSEC-2026-3171","PYSEC-2026-3319","PYSEC-2026-989"],"modified":"2026-08-12T13:01:16.051216Z","published":"2022-09-16T19:40:11Z","related":["openSUSE-SU-2024:12355-1"],"database_specific":{"cwe_ids":["CWE-787"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35939.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://github.com/tensorflow/tensorflow/blob/266558ac4c1f361e9a178ee9d3f0ce2e648ae499/tensorflow/lite/kernels/internal/reference/reference_ops.h#L659-L698"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35939.json"},{"type":"ADVISORY","url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-ffjm-4qwc-7cmf"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35939"},{"type":"FIX","url":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/tensorflow/tensorflow","events":[{"introduced":"c256c071bb26e1e13b4666d1b3e229e110bc914a"},{"fixed":"dd7b8a3c1714d0052ce4b4a2fd8dcef927439a24"},{"introduced":"3f878cff5b698b82eea85db2b60d65a2e320850e"},{"fixed":"0516d4d8bced506cae97dc3cb45dbd2fe4311f26"},{"introduced":"8a20d54a3c1bfa38c03ea99a2ad3c1b0a45dfa95"},{"fixed":"d8ce9f9c301d021a69953134185ab728c1c248d3"},{"fixed":"b4d4b4cb019bd7240a52daa4ba61e3cc814f0384"}],"database_specific":{"cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*","extracted_events":[{"introduced":"2.7.0"},{"fixed":"2.7.2"},{"introduced":"2.8.0"},{"fixed":"2.8.1"},{"introduced":"2.9.0"},{"fixed":"2.9.1"}],"source":["CPE_RANGE","REFERENCES"]}}],"versions":["v2.9.0","v2.7.1","v2.8.0","v2.7.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-35939.json","vanir_signatures_modified":"2026-08-12T13:01:16Z","vanir_signatures":[{"source":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384","target":{"function":"EvalScatterNd","file":"tensorflow/lite/kernels/scatter_nd.cc"},"deprecated":false,"digest":{"function_hash":"88660301675476796987106789204566207692","length":1111},"id":"CVE-2022-35939-0153728c","signature_type":"Function","signature_version":"v1"},{"source":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384","target":{"function":"ScatterNd","file":"tensorflow/lite/kernels/scatter_nd.cc"},"deprecated":false,"digest":{"function_hash":"32509588709423475834545933470134783761","length":360},"id":"CVE-2022-35939-04762d60","signature_type":"Function","signature_version":"v1"},{"deprecated":false,"digest":{"line_hashes":["10196311572858101780425223704561390610","45697305920059453530634393722303556034","236490789027345679493283741390057876193","116353466209209729662383319668547981316","200251332102716127826012960462443570343","275636612688260052826882022987141613522","11029614242285074530640626585401838389","82620988280291628029476066076046124610","276738631086406156360494321765525189727","19107259462648352921105062884498519331","176658947424168961074802982904132393810","267170417384166334364145318594245866351","202726233261045615230415275968255480784","324819243310478030798019493943461092798","227018572287402934403161262872459362348","95530594372275132608474369312982810230","99950477556478742351407092705421175287","233969252416853689137423489511209408143","317852061953778372402785701150268431405","119633777497000573685443587951206376549","305754392444422199397154104763848096124","155031258370045576134347739408892796081","308106827666253246504241270368847144490"],"threshold":0.9},"id":"CVE-2022-35939-191ff65c","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384","target":{"file":"tensorflow/lite/kernels/internal/reference/reference_ops.h"}},{"digest":{"line_hashes":["51568937280560153342134762461145558414","188775624416912301116912723096519677099"],"threshold":0.9},"id":"CVE-2022-35939-a8d42015","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384","target":{"file":"tensorflow/lite/kernels/scatter_nd_test.cc"},"deprecated":false},{"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["224969615451382106808207559055152142598","318300074076033700489901260723564015632","91212143163786873414254318443748426244","111635074559468297971941614567635041031","281561786052698297746473258601574691442","197161479606035535991192516007617578856","134069285108961910101943912031472885829","196702361935610974018083101901823475258","63220347239335160562084448647137206999","313840063478534468599531197525695597275","98377798761930441413281494252269947886","204929776440175475607624903482587015656","3161742314842891310153388891027804217","244705346665294102297837329520404425739","177490565427480251282156747473036269472","313413136272521670660814125413972958636","80135961914300675743579199277311021396","332835132938461562112750991141379468902","336997009910258421872965734553783686441","73296640617457467559758845766962742496","174791989325548425629586687226716017229","105450201647304767284336170343690508294","278689795811493671589368890752316851722","174881256008609007835669730583506852590","221625177443754996529281756772639267561","135696461055770317401655174654200494082","259102109367751664907623770371108055665","161950358800164199403971349962480623146","21760561344547475538506474086811147310","149670965336767361446680407152563024758"]},"id":"CVE-2022-35939-d697a4aa","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384","target":{"file":"tensorflow/lite/kernels/scatter_nd.cc"}},{"target":{"file":"tensorflow/lite/kernels/internal/reference/reference_ops.h","function":"ScatterNd"},"deprecated":false,"digest":{"length":1121,"function_hash":"238979639184525859867466769723278544910"},"id":"CVE-2022-35939-e67c485a","signature_type":"Function","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/b4d4b4cb019bd7240a52daa4ba61e3cc814f0384"}]}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:H"}]}