{"id":"CVE-2022-35937","summary":"OOB read in `Gather_nd` op in TensorFlow Lite","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 is triggered. This issue has been patched in GitHub commit 595a65a3e224a0362d7e68c2213acfc2b499a196. 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-35937","GHSA-pxrw-j2fv-hx3h","PYSEC-2026-1027","PYSEC-2026-3226","PYSEC-2026-3359"],"modified":"2026-08-12T13:01:24.341341Z","published":"2022-09-16T19:40:20Z","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-35937.json"},"references":[{"type":"WEB","url":"https://github.com/tensorflow/tensorflow/blob/f463040eb3997e42e60a2ffc6dc72de7ef11dbb4/tensorflow/lite/kernels/gather_nd.cc#L105-L111"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/35xxx/CVE-2022-35937.json"},{"type":"ADVISORY","url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-pxrw-j2fv-hx3h"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-35937"},{"type":"FIX","url":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/tensorflow/tensorflow","events":[{"introduced":"c256c071bb26e1e13b4666d1b3e229e110bc914a"},{"fixed":"dd7b8a3c1714d0052ce4b4a2fd8dcef927439a24"},{"introduced":"3f878cff5b698b82eea85db2b60d65a2e320850e"},{"fixed":"0516d4d8bced506cae97dc3cb45dbd2fe4311f26"},{"introduced":"8a20d54a3c1bfa38c03ea99a2ad3c1b0a45dfa95"},{"fixed":"d8ce9f9c301d021a69953134185ab728c1c248d3"},{"fixed":"595a65a3e224a0362d7e68c2213acfc2b499a196"}],"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","REFERENCES"],"cpe":"cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*"}}],"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-35937.json","vanir_signatures_modified":"2026-08-12T13:01:24Z","vanir_signatures":[{"deprecated":false,"digest":{"function_hash":"5582336635074474065535125421207522662","length":357},"id":"CVE-2022-35937-0058dfdf","signature_type":"Function","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196","target":{"file":"tensorflow/lite/kernels/gather_nd.cc","function":"GatherNd"}},{"target":{"file":"tensorflow/lite/kernels/gather_nd_test.cc"},"deprecated":false,"digest":{"line_hashes":["311277416330119409064812886202797178195","272462161769494939553661480694458739556","132261558903948867380706469045776990954"],"threshold":0.9},"id":"CVE-2022-35937-ca979f6a","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196"},{"source":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196","target":{"file":"tensorflow/lite/kernels/gather_nd.cc","function":"EvalGatherNd"},"deprecated":false,"digest":{"function_hash":"71754428811623220191000347481505916258","length":1153},"id":"CVE-2022-35937-ceadf6fe","signature_type":"Function","signature_version":"v1"},{"deprecated":false,"digest":{"function_hash":"51582351497515176334426324685092336318","length":542},"id":"CVE-2022-35937-e8acf95c","signature_type":"Function","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196","target":{"file":"tensorflow/lite/kernels/internal/reference/reference_ops.h","function":"GatherNd"}},{"deprecated":false,"digest":{"line_hashes":["319489268034674269356564257310549289787","219575398413569432053623071624515980461","127013588394099529531765132617156600775","135395165283213369109169822552621455040","197687435579514443585088415622134928900","102929531377009217062980782909235764268","50148554513652654730444195399303328270","164414835850063536095408034659263664464","169100135643610329785849770225557881565","203746292561634411658269683911256070916","161349445749750300252647058651559340567","94719079772156010514922312306306955686","70727024204315612874109581712748703413","36064993754584108832433138970428628469","90681313436896570395144722765733154914","322684153374133439717187413979545217435","17066868521677568542746907492077073361","219947779056418606506964417942162971949","248162041520545714717964159361234671120","320094175678886037793593697163905300367","176826647537295345700877113278851201053","74719904999699133307061425034337253923","225367846026740493118138789709446139881","48294551008088095914701345993406968690","217391970139581146413218741779333925663"],"threshold":0.9},"id":"CVE-2022-35937-eeb7d0a7","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196","target":{"file":"tensorflow/lite/kernels/gather_nd.cc"}},{"deprecated":false,"digest":{"line_hashes":["51809852713179318702305226245307455760","223730219420654410978254653104816281084","37067845323110335944204139052067103591","218681550635134858936789421687906771820","291536804117229386310766360080925881563","336054178290228206048418637263024959424","78152396127377523943638034737014960424","63627696470611501211667813394485113372","59554358171572665967545283699681337111","231799369253609867677324270969534526940","127241147953596091335367808333332160816","158893449951207146339296536720642819661","333863504251852572652840183782349536134","245625567984582803776770779217495581692","239450746905223060766542183065913064061","331532678763735707221714169701402818083","109779172391974618066664358283577304788","76437584024434387779041898893812652847","264297926956797081944763944509773013007","218172287489586004492561577067266563407","94085290793902343705000446275745790665","159910750031684497594705773803750563310","168442689803827126133712241536568124415"],"threshold":0.9},"id":"CVE-2022-35937-eeedb997","signature_type":"Line","signature_version":"v1","source":"https://github.com/tensorflow/tensorflow/commit/595a65a3e224a0362d7e68c2213acfc2b499a196","target":{"file":"tensorflow/lite/kernels/internal/reference/reference_ops.h"}}]}}],"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"}]}