Tesseract OCR engine versions prior to 5.5.4 contain a double free and use-after-free vulnerability in the AppendLinePolygon function, which can corrupt memory during processing of right-to-left text such as Hebrew or Arabic. Additionally, a denial of service vulnerability exists due to improper handling of crafted LSTM model data in WeightMatrix::DeSerializeOld, causing process termination. Both issues are fixed in version 5.5.4.