A Semantic Attack on Google Gemini - Read the Latest Research
The security vulnerability is a path traversal issue within the attachment handling of the usememos/memos application. The root cause was the lack of input validation on the filename parameter for both creating and updating attachments. The functions APIV1Service.CreateAttachment and APIV1Service.UpdateAttachment in server/router/api/v1/attachment_service.go directly used the user-provided filename without sanitization. The patch 5f57f48673e2054f404b2c5b497a8eaa3690591d rectifies this by introducing a new validateFilename function. This function is now called within both CreateAttachment and UpdateAttachment to ensure the filename does not contain any path traversal characters (/ or \) and is a valid local file path. Before this fix, an attacker could craft a request with a malicious filename to write or overwrite files outside of the intended storage directory.
APIV1Service.CreateAttachmentserver/router/api/v1/attachment_service.go
APIV1Service.UpdateAttachmentserver/router/api/v1/attachment_service.go
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/usememos/memos | go | < 0.25.3 | 0.25.3 |