Banana Slides through 0.4.0, patched in commit e8bc490, contains a path traversal vulnerability in the generate_image() function within the AI service backend that allows unauthenticated attackers to read arbitrary image-format files outside the intended uploads directory by exploiting an incomplete path prefix check using os.path.startswith() without a trailing separator. Attackers can supply crafted markdown image references in user-controlled page descriptions that resolve to sibling directories whose names share the uploads folder prefix, bypassing the directory confinement check and causing the application to read files from unintended locations via PIL Image.open().
Banana Slides versions up to 0.4.0 contain a path traversal vulnerability in the image generation function that allows unauthenticated attackers to read arbitrary files outside the uploads directory. The vulnerability exploits incomplete path validation using os.path.startswith() without proper directory separator checks, enabling attackers to access sensitive files through crafted markdown references.
تحتوي وظيفة generate_image() في خدمة Banana Slides الخلفية على ثغرة اجتياز مسار تسمح بقراءة ملفات الصور التعسفية خارج دليل التحميلات المقصود. يستغل المهاجمون عدم اكتمال فحص بادئة المسار الذي يستخدم os.path.startswith() بدون فاصل زائدة، مما يسمح بالوصول إلى الملفات من خلال مراجع markdown مصنوعة في أوصاف الصفحات التي يتحكم فيها المستخدم.
تحتوي نسخ Banana Slides حتى 0.4.0 على ثغرة اجتياز المسار في وظيفة إنشاء الصور التي تسمح للمهاجمين غير المصرح لهم بقراءة ملفات عشوائية خارج دليل التحميلات. تستغل الثغرة التحقق غير الكامل من المسار باستخدام os.path.startswith() بدون فواصل دليل مناسبة، مما يمكّن المهاجمين من الوصول إلى الملفات الحساسة من خلال مراجع markdown مصنوعة.
Upgrade Banana Slides to version 0.4.1 or later, or apply commit e8bc490 which implements proper path validation using os.path.join() with normalized absolute paths and validates that resolved paths remain within the intended uploads directory using os.path.commonpath() or equivalent checks. Implement input sanitization for markdown image references and enforce strict file access controls.
قم بترقية Banana Slides إلى الإصدار 0.4.1 أو أحدث، أو طبّق commit e8bc490 الذي ينفذ التحقق الصحيح من المسار باستخدام os.path.join() مع المسارات المطلقة المعايرة والتحقق من أن المسارات المحللة تبقى ضمن دليل التحميلات المقصود باستخدام os.path.commonpath() أو فحوصات معادلة. طبّق تنظيف المدخلات لمراجع صور markdown وفرض ضوابط وصول صارمة للملفات.