{"id":"CVE-2026-88049","summary":"Tesseract: Heap out-of-bounds write in LSTM::Forward via na_/gate-matrix dimension mismatch","details":"Tesseract is an open source OCR engine. In version 5.5.3 and earlier, prior .traineddata hardening added bounds checks to NetworkIO::CopyTimeStepGeneral and NetworkIO::Randomize in src/lstm/networkio.cpp but left NetworkIO::WriteTimeStepPart and NetworkIO::AddTimeStepPart unchecked. In LSTM::Forward in src/lstm/lstm.cpp, source_ is sized from the independently deserialized na_ field while the WriteTimeStepPart count is ns_, which comes from the CI gate WeightMatrix dim1() value. A crafted NT_LSTM layer can make ns_ much larger than na_, causing a heap out-of-bounds write during the first recognition step on the default LSTM engine and resulting in heap corruption, a crash, or potentially controlled corruption. No fixed release is available as of this review.","aliases":["GHSA-jgq8-pprg-vc68"],"modified":"2026-09-12T08:07:32.779629Z","published":"2026-09-10T16:23:18.718Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-787"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/88xxx/CVE-2026-88049.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/88xxx/CVE-2026-88049.json"},{"type":"ADVISORY","url":"https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-jgq8-pprg-vc68"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-88049"},{"type":"FIX","url":"https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/tesseract-ocr/tesseract","events":[{"introduced":"0"},{"fixed":"b494ac18925f9d9aff9ef5815475de9943ab19bf"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"last_affected":"5.5.3"}],"source":["AFFECTED_FIELD","REFERENCES"]}}],"versions":["5.5.3","5.5.2","5.5.1","5.5.0","5.4.1","5.4.0","5.4.0-rc2","5.4.0-rc1","5.3.4","5.3.3","5.3.2","5.3.1","5.3.0","5.3.0-rc1","5.2.0","5.1.0","5.0.1","5.0.0","5.0.0-rc3","5.0.0-rc2","5.0.0-rc1","5.0.0-beta-20210916","5.0.0-alpha-20210401","5.0.0-alpha-20201231","5.0.0-alpha-20201224","5.0.0-alpha","4.1.0-rc1","4.0.0","4.0.0-rc4","4.0.0-rc3","4.0.0-beta.4","4.0.0-beta.3","4.0.0-beta.1","4.00.00dev","4.00.00alpha","4.0.0-alpha","3.03-rc1","3.05.00dev","3.04.00","3.02.02","3.01","3.00","2.04","2.03","2.02","2.01","2.00","1.04b","1.04","1.03"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-88049.json","vanir_signatures_modified":"2026-09-12T08:07:32Z","vanir_signatures":[{"signature_version":"v1","source":"https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf","target":{"file":"src/lstm/lstm.cpp"},"deprecated":false,"digest":{"line_hashes":["209512721576218864927573826106418489188","59403125058470684794593178349545683042","173058667334577194725727368579867633870","328696115079477068244684381867707141478","3056731079894247321311877609379456220","272832158999540919890349607841118428611","137577515337417137736065449595949797879","157230388833271912771774776007494806541","207572192283406907931867407208928278186","135028221427936296293723452663157715484"],"threshold":0.9},"id":"CVE-2026-88049-6bda76a1","signature_type":"Line"},{"deprecated":false,"digest":{"function_hash":"144089817832966393723733675287255721398","length":468},"id":"CVE-2026-88049-98e1bf46","signature_type":"Function","signature_version":"v1","source":"https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf","target":{"function":"NetworkIO::WriteTimeStepPart","file":"src/lstm/networkio.cpp"}},{"digest":{"function_hash":"112452954040273889575591163190390322117","length":417},"id":"CVE-2026-88049-a2c02bbb","signature_type":"Function","signature_version":"v1","source":"https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf","target":{"file":"src/lstm/networkio.cpp","function":"NetworkIO::AddTimeStepPart"},"deprecated":false},{"target":{"file":"src/lstm/networkio.cpp"},"deprecated":false,"digest":{"line_hashes":["235463704056339205605421355812202320123","150196273073698294630307509660929087239","50098622174369721230692496129024534675","299100341497460667581153472037492818105","125252073213066878877642176195149965630","139686543606762918256510988102541966515","265052017573679243576608418516583325800","50528733593273402677562375013982994824"],"threshold":0.9},"id":"CVE-2026-88049-be5614bf","signature_type":"Line","signature_version":"v1","source":"https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf"},{"target":{"function":"LSTM::DeSerialize","file":"src/lstm/lstm.cpp"},"deprecated":false,"digest":{"function_hash":"30491705012578551204841131708028680264","length":818},"id":"CVE-2026-88049-dce66cb3","signature_type":"Function","signature_version":"v1","source":"https://github.com/tesseract-ocr/tesseract/commit/b494ac18925f9d9aff9ef5815475de9943ab19bf"}]}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}]}