{"id":"CVE-2022-35938","summary":"OOB read in `Gather_nd` op in TensorFlow Lite Micro","details":"TensorFlow is an open source platform for machine learning. The `GatherNd` function takes arguments that determine the sizes of inputs and outputs. If the inputs given are greater than or equal to the sizes of the outputs, an out-of-bounds memory read or a crash is triggered. This issue has been patched in GitHub commit 4142e47e9e31db481781b955ed3ff807a781b494. 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-35938","GHSA-3m3g-pf5v-5hpj"],"modified":"2026-08-12T13:01:22.953883Z","published":"2022-09-16T19:35:10Z","related":["openSUSE-SU-2024:12355-1"],"database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-125"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35938.json"},"references":[{"type":"WEB","url":"https://github.com/tensorflow/tflite-micro/blob/1bc98621180a350eb4e8d3318ea8e228c7559b37/tensorflow/lite/micro/kernels/gather_nd.cc#L143-L154"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35938.json"},{"type":"ADVISORY","url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-3m3g-pf5v-5hpj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35938"},{"type":"FIX","url":"https://github.com/tensorflow/tflite-micro/commit/4142e47e9e31db481781b955ed3ff807a781b494"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/tensorflow/tensorflow","events":[{"introduced":"c256c071bb26e1e13b4666d1b3e229e110bc914a"},{"fixed":"dd7b8a3c1714d0052ce4b4a2fd8dcef927439a24"},{"introduced":"3f878cff5b698b82eea85db2b60d65a2e320850e"},{"fixed":"0516d4d8bced506cae97dc3cb45dbd2fe4311f26"},{"introduced":"8a20d54a3c1bfa38c03ea99a2ad3c1b0a45dfa95"},{"fixed":"d8ce9f9c301d021a69953134185ab728c1c248d3"}],"database_specific":{"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","cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*"}},{"type":"GIT","repo":"https://github.com/tensorflow/tflite-micro","events":[{"introduced":"0"},{"fixed":"4142e47e9e31db481781b955ed3ff807a781b494"}],"database_specific":{"source":"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-35938.json","vanir_signatures_modified":"2026-08-12T13:01:22Z","vanir_signatures":[{"signature_type":"Function","signature_version":"v1","source":"https://github.com/tensorflow/tflite-micro/commit/4142e47e9e31db481781b955ed3ff807a781b494","target":{"file":"tensorflow/lite/micro/kernels/gather_nd.cc","function":"GatherNd"},"deprecated":false,"digest":{"length":1170,"function_hash":"183431517256494137937988705297667174025"},"id":"CVE-2022-35938-05914291"},{"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["172868686126579977706462102148303481733","128477290942480978048900883005859923886","25707960934227168686429538546830786267","28110608296669133398851552752974766365","113966225575461117993290862761256434758","40319056505249789551850537394168305361","287196495033260672047021122680326115026","170270655116428351933704394775679738615","274408005127817836800921448590734635803","276928928591783492417841692797542580387","50690205441532570749685890914809392622","236198665339049340652901553271074097925","76080599232024199171385691359815712089","29437743153888741814952989566414326401","144664601600875183887359777738147375190"]},"id":"CVE-2022-35938-53bcc616","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tflite-micro/commit/4142e47e9e31db481781b955ed3ff807a781b494","target":{"file":"tensorflow/lite/micro/kernels/gather_nd_test.cc"}},{"source":"https://github.com/tensorflow/tflite-micro/commit/4142e47e9e31db481781b955ed3ff807a781b494","target":{"file":"tensorflow/lite/micro/kernels/gather_nd.cc"},"deprecated":false,"digest":{"line_hashes":["21063800025693572702665802345969839785","299510730061422516593047484493057379004","103324045029083142195868886925064505752","273823810516478010873580982706867243693","169787140351805979860224002633999490939","32395051254449099796878606193554319202","232926031928179118852170692724465608479","55676159297800976567363053510352829276","219548954323975310889101830963939918253","172032520877714898526809573955315720031","116726641629009299933880195942338397684","31872184083950579031142774629636333921","34186748145482761631547457551337726051","129291248707547548245553874742702784472","117247492060902499893649714408958284111","326884366346153209332232335001138003851","205018532489966606811756843000534035487","72289045920107001257199356477758765964","261969746425296402734792148147263258126","176467608597132587248678999297556128333","21760561344547475538506474086811147310","144681814553737244871834218399209044726"],"threshold":0.9},"id":"CVE-2022-35938-7a650d6b","signature_type":"Line","signature_version":"v1"},{"id":"CVE-2022-35938-c0de3c0d","signature_type":"Function","signature_version":"v1","source":"https://github.com/tensorflow/tflite-micro/commit/4142e47e9e31db481781b955ed3ff807a781b494","target":{"file":"tensorflow/lite/micro/kernels/gather_nd.cc","function":"EvalGatherNd"},"deprecated":false,"digest":{"function_hash":"96290645503860118615691933362014751349","length":479}},{"source":"https://github.com/tensorflow/tflite-micro/commit/4142e47e9e31db481781b955ed3ff807a781b494","target":{"file":"tensorflow/lite/micro/kernels/gather_nd_test.cc","function":"TestGatherNd"},"deprecated":false,"digest":{"function_hash":"249845567524816823534167836598391243825","length":963},"id":"CVE-2022-35938-d9c8d000","signature_type":"Function","signature_version":"v1"}]}}],"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"}]}