{"id":"CVE-2026-119338","state":"PUBLISHED","title":"Tesseract: Double free and use after free in the PAGE XML renderer on right-to-left pages","description":"Tesseract is an open source OCR engine. From 5.4.0 until 5.5.4, AppendLinePolygon in src/api/pagerenderer.cpp destroys the caller-owned right-to-left Pta accumulator while receiving it by value, leaving line_top_rtl_pts and line_bottom_rtl_pts dangling. On an upright Hebrew or Arabic page at the default PAGE XML level, POLYGONFLAG with a false skewed_flag enters the vulnerable calls, while LEVELFLAG greater than zero provides an alternative gate. The calls repeatedly read and free the stale object, causing a double free and use after free and allowing corrupted coordinates to reach RecalcPolygonline. This issue is fixed in version 5.5.4.","publishedAt":"2026-10-30T20:12:29.030Z","updatedAt":"2026-10-30T20:12:29.030Z","severity":{"score":6.9,"label":"Medium","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N","source":"GitHub_M"},"assigner":"GitHub_M","products":["tesseract-ocr tesseract"],"affected":[{"vendor":"tesseract-ocr","product":"tesseract","versions":[{"version":">= 5.4.0, < 5.5.4","status":"affected"}]}],"references":["https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j","https://github.com/tesseract-ocr/tesseract/pull/4647","https://github.com/tesseract-ocr/tesseract/commit/fa52414ff1fd13ae4b00048d2498f9141b0bc2eb","https://github.com/tesseract-ocr/tesseract/releases/tag/5.5.4"],"weaknesses":["CWE-125","CWE-415","CWE-416"],"ingestedAt":"2026-10-30T20:20:07.083Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/119xxx/CVE-2026-119338.json","commit":"00b08630266947671d4e9b6c8d071b69dbb66e11","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-119338","state":"PUBLISHED","datePublished":"2026-10-30T20:12:29.030Z","dateUpdated":"2026-10-30T20:12:29.030Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-10-29T20:44:30.286Z"},"containers":{"cna":{"title":"Tesseract: Double free and use after free in the PAGE XML renderer on right-to-left pages","descriptions":[{"lang":"en","value":"Tesseract is an open source OCR engine. From 5.4.0 until 5.5.4, AppendLinePolygon in src/api/pagerenderer.cpp destroys the caller-owned right-to-left Pta accumulator while receiving it by value, leaving line_top_rtl_pts and line_bottom_rtl_pts dangling. On an upright Hebrew or Arabic page at the default PAGE XML level, POLYGONFLAG with a false skewed_flag enters the vulnerable calls, while LEVELFLAG greater than zero provides an alternative gate. The calls repeatedly read and free the stale object, causing a double free and use after free and allowing corrupted coordinates to reach RecalcPolygonline. This issue is fixed in version 5.5.4."}],"affected":[{"vendor":"tesseract-ocr","product":"tesseract","versions":[{"version":">= 5.4.0, < 5.5.4","status":"affected"}]}],"references":[{"url":"https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j","name":"https://github.com/tesseract-ocr/tesseract/security/advisories/GHSA-vf7v-2h4f-6f4j","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tesseract-ocr/tesseract/pull/4647","name":"https://github.com/tesseract-ocr/tesseract/pull/4647","tags":["x_refsource_MISC"]},{"url":"https://github.com/tesseract-ocr/tesseract/commit/fa52414ff1fd13ae4b00048d2498f9141b0bc2eb","name":"https://github.com/tesseract-ocr/tesseract/commit/fa52414ff1fd13ae4b00048d2498f9141b0bc2eb","tags":["x_refsource_MISC"]},{"url":"https://github.com/tesseract-ocr/tesseract/releases/tag/5.5.4","name":"https://github.com/tesseract-ocr/tesseract/releases/tag/5.5.4","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV4_0":{"attackVector":"LOCAL","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"PASSIVE","vulnConfidentialityImpact":"LOW","vulnIntegrityImpact":"LOW","vulnAvailabilityImpact":"HIGH","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":6.9,"baseSeverity":"MEDIUM","vectorString":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N","version":"4.0"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-125","lang":"en","description":"CWE-125: Out-of-bounds Read","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-415","lang":"en","description":"CWE-415: Double Free","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-416","lang":"en","description":"CWE-416: Use After Free","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-10-30T20:12:29.030Z"},"source":{"advisory":"GHSA-vf7v-2h4f-6f4j","discovery":"UNKNOWN"}}}}}