Tesseract OCR engine versions prior to 5.5.4 contain a use-after-free and double free vulnerability in the AppendLinePolygon function, which can corrupt memory during processing of right-to-left text such as Hebrew or Arabic. This flaw allows corrupted coordinates to reach internal functions, potentially causing instability. Additionally, a denial of service issue exists in the WeightMatrix::DeSerialize function when loading crafted LSTM models, causing process termination. Both issues are fixed in version 5.5.4.