libsixel is a SIXEL encoder/decoder implementation derived from kmiya's sixel. From to 1.8.7-r1, signed integer overflow in sixel_encode_highcolor's allocation size calculation can lead to a heap buffer overflow. The public sixel_encode entry point validates only that width and height are greater than zero, with no upper bound. width and height are multiplied as plain int when computing the allocation size for paletted_pixels and normalized_pixels. Any caller that asks libsixel to encode a pixel buffer with width times height greater than INT_MAX (about 2.15 billion) will hit a wrapped allocation size; under the right wrap, the malloc succeeds with a buffer much smaller than the encoder expects, and the encoder writes past the end of the heap allocation. This vulnerability is fixed in 1.8.7-r2.
libsixel versions before 1.8.7-r2 contain a signed integer overflow in heap buffer allocation that can be exploited through the sixel_encode function with large width/height parameters. This vulnerability allows attackers to trigger heap buffer overflow by providing image dimensions exceeding INT_MAX, potentially leading to memory corruption and code execution.
يحتوي libsixel على خلل في دالة sixel_encode_highcolor حيث يتم حساب حجم التخصيص باستخدام ضرب عددين صحيحين بدون فحص الحدود العليا. عندما يكون حاصل ضرب العرض والارتفاع أكبر من INT_MAX (حوالي 2.15 مليار)، يحدث تجاوز في العدد الصحيح مما يؤدي إلى تخصيص مخزن مؤقت أصغر من المتوقع. يكتب المشفر بعد نهاية المخزن المؤقت المخصص مما يسبب تلف الذاكرة.
مكتبة libsixel الإصدارات السابقة 1.8.7-r2 تحتوي على تجاوز عدد صحيح موقع في تخصيص المخزن المؤقت للكومة يمكن استغلاله من خلال دالة sixel_encode. يمكن لمهاجمين تشغيل تجاوز المخزن المؤقت للكومة بتوفير أبعاد صورة تتجاوز INT_MAX مما قد يؤدي إلى تلف الذاكرة وتنفيذ الأكواد.
Update libsixel to version 1.8.7-r2 or later immediately. Implement input validation in applications using libsixel to enforce reasonable upper bounds on image width and height parameters before passing to encoding functions. Validate that width * height does not exceed safe integer limits.
قم بتحديث libsixel إلى الإصدار 1.8.7-r2 أو أحدث فوراً. طبق التحقق من صحة المدخلات في التطبيقات التي تستخدم libsixel لفرض حدود عليا معقولة على معاملات عرض وارتفاع الصورة قبل تمريرها إلى وظائف الترميز. تحقق من أن عرض × ارتفاع لا يتجاوز حدود الأعداد الصحيحة الآمنة.