Description
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().
Problem types
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Product status
Any version
e8bc490ec8b4b657e07dc3ab4e94fbedcaade421 (git)
Credits
YU SUN
References
github.com/Anionex/banana-slides/issues/429
github.com/Anionex/banana-slides/pull/430
github.com/...ommit/e8bc490ec8b4b657e07dc3ab4e94fbedcaade421
www.vulncheck.com/...sal-via-generate-image-in-ai-service-py